fix: hint shell builtins in command-not-found error (fixes #1944)#1998
Closed
wyf027 wants to merge 4 commits into
Closed
fix: hint shell builtins in command-not-found error (fixes #1944)#1998wyf027 wants to merge 4 commits into
wyf027 wants to merge 4 commits into
Conversation
When a user runs `fd -x cd` or similar shell builtins that lack standalone executables, the "Command not found" error now explains that the command is a shell builtin and suggests invoking it through a shell explicitly.
Use SHELL_BUILTINS.contains(&program) instead of iter().any(). Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Gentle ping — CI green (including clippy). Ready for review. Thanks! |
Contributor
Author
|
Still green and ready for review. Can close if #1994 is updated with the clippy fix instead. |
Expand the troubleshooting section for #1944. Co-authored-by: Cursor <cursoragent@cursor.com>
1 task
Contributor
Author
Contributor
Author
|
Friendly ping — CI green; happy to close in favor of #1994 if you prefer merging there after clippy is fixed. Thanks! |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
fd -x/-Xfails with "command not found" for a known shell builtin (e.g.cd), print a clearer error that explains builtins must be run via an explicit shell invocation.Fixes #1944.
Context
Implementation follows the approach discussed in #1944 and aligns with PR #1994 by @kimjune01. That PR currently fails CI on
clippy::manual-contains; this branch includes the same feature plus:Happy to close this in favor of #1994 if the author updates their branch — goal is to get a green CI fix merged.
Checks
cargo fmt -- --checkcargo clippy --all-targets --all-features -- -Dwarningscargo test --locked