Skip to content

fix: show path separator error for all patterns with separators#1942

Closed
cyphercodes wants to merge 1 commit intosharkdp:masterfrom
cyphercodes:fix/path-separator-error-consistency
Closed

fix: show path separator error for all patterns with separators#1942
cyphercodes wants to merge 1 commit intosharkdp:masterfrom
cyphercodes:fix/path-separator-error-consistency

Conversation

@cyphercodes
Copy link
Copy Markdown

The 'pattern contains path separator' error was only shown when the pattern was an existing directory. This caused inconsistent behavior where 'fd /' showed an error but 'fd /nonexistent/path' silently found nothing.

This fix removes the Path::is_dir() check so the error is shown consistently whenever a pattern contains a path separator, improving user experience with clear feedback.

Fixes #1873

The 'pattern contains path separator' error was only shown when the
pattern was an existing directory. This caused inconsistent behavior
where 'fd /' showed an error but 'fd /nonexistent/path' silently
found nothing.

This fix removes the Path::is_dir() check so the error is shown
consistently whenever a pattern contains a path separator, improving
user experience with clear feedback.

Fixes sharkdp#1873
@tmccombs tmccombs closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] The 'pattern contains path separator' error is only shown when pattern is an existing directory

2 participants