Skip to content

fix: hint shell builtins in command-not-found error#2014

Open
wyf027 wants to merge 1 commit into
sharkdp:masterfrom
wyf027:fix/shell-builtin-hint-1944-v2
Open

fix: hint shell builtins in command-not-found error#2014
wyf027 wants to merge 1 commit into
sharkdp:masterfrom
wyf027:fix/shell-builtin-hint-1944-v2

Conversation

@wyf027

@wyf027 wyf027 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When -x/-X fails with "command not found" for a known shell builtin (e.g. cd), append a hint that builtins must be run through a shell
  • Update the README troubleshooting section to cover builtins alongside aliases/functions
  • Add unit tests for builtin detection and error message formatting

Fixes #1944

Test plan

  • cargo test exec::command
  • cargo clippy -- -D warnings
  • fd -t d -x cd shows the new hint message

When -x/-X fails because the program is a shell builtin (e.g. cd),
include a short note and an example of invoking a shell explicitly.

Fixes sharkdp#1944
@wyf027 wyf027 force-pushed the fix/shell-builtin-hint-1944-v2 branch from 4722a38 to ecd8a7e Compare May 26, 2026 04:40
@tmccombs

Copy link
Copy Markdown
Collaborator

There's already an open pr for this

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.

'command not found' when running fd with -x cd

2 participants