From d45c99b80706ca51b40a0b20f37e8cfe8f5146c2 Mon Sep 17 00:00:00 2001 From: Yoshi Tacke <77861115+YoshKoz@users.noreply.github.com> Date: Mon, 20 Apr 2026 10:24:33 +0200 Subject: [PATCH 1/2] docs: document PowerShell placeholder quoting requirement Closes #735 --- CHANGELOG.md | 3 +++ README.md | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4b013bb4..49eb5a3d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ ## Bugfixes - Handle invalid working directories gracefully when using `--full-path`, see #1900 (@Xavrir). +## Documentation +- Document PowerShell placeholder quoting requirement in the troubleshooting section, see #735 (@YoshKoz) + # 10.4.2 ## Bugfixes diff --git a/README.md b/README.md index e511a07db..5bab649fa 100644 --- a/README.md +++ b/README.md @@ -444,6 +444,23 @@ you can use `export -f my_function` to make available to child processes. You wo need to call `fd -x bash -c 'my_function "$1"' bash`. For other use cases or shells, use a (temporary) shell script. +### Placeholders (`{}`, `{/}`, `{//}`, `{.}`, `{/.}`) in PowerShell + +In PowerShell (both Windows PowerShell and PowerShell 7+), curly braces `{}` are reserved +for script blocks. Passing them unquoted to `fd -x`/`fd -X` will cause PowerShell to +interpret them before `fd` sees them, breaking the placeholder. Wrap any placeholder in +single quotes (or escape the braces with backticks): + +``` powershell +# Won't work — PowerShell parses `{/}` as a script block: +fd -e txt -x echo {/} + +# Works — single quotes pass `{/}` through to fd untouched: +fd -e txt -x echo '{/}' +``` + +The same rule applies to `{}`, `{//}`, `{.}`, and `{/.}`. + ## Integration with other programs ### Using fd with `fzf` From c7f4f19ffbd521b0271162012083307ab929bcb0 Mon Sep 17 00:00:00 2001 From: Yoshi Tacke <77861115+YoshKoz@users.noreply.github.com> Date: Mon, 20 Apr 2026 20:11:02 +0200 Subject: [PATCH 2/2] docs: address review feedback Drop CHANGELOG entry for docs-only change. Simplify placeholder note to be shell-agnostic per reviewer request. --- CHANGELOG.md | 3 --- README.md | 18 +++--------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49eb5a3d0..e4b013bb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,6 @@ ## Bugfixes - Handle invalid working directories gracefully when using `--full-path`, see #1900 (@Xavrir). -## Documentation -- Document PowerShell placeholder quoting requirement in the troubleshooting section, see #735 (@YoshKoz) - # 10.4.2 ## Bugfixes diff --git a/README.md b/README.md index 5bab649fa..18a56d529 100644 --- a/README.md +++ b/README.md @@ -444,22 +444,10 @@ you can use `export -f my_function` to make available to child processes. You wo need to call `fd -x bash -c 'my_function "$1"' bash`. For other use cases or shells, use a (temporary) shell script. -### Placeholders (`{}`, `{/}`, `{//}`, `{.}`, `{/.}`) in PowerShell +### Placeholders in `-x`/`-X` -In PowerShell (both Windows PowerShell and PowerShell 7+), curly braces `{}` are reserved -for script blocks. Passing them unquoted to `fd -x`/`fd -X` will cause PowerShell to -interpret them before `fd` sees them, breaking the placeholder. Wrap any placeholder in -single quotes (or escape the braces with backticks): - -``` powershell -# Won't work — PowerShell parses `{/}` as a script block: -fd -e txt -x echo {/} - -# Works — single quotes pass `{/}` through to fd untouched: -fd -e txt -x echo '{/}' -``` - -The same rule applies to `{}`, `{//}`, `{.}`, and `{/.}`. +Depending on your shell, you may need to quote the placeholders (`{}`, `{/}`, `{//}`, +`{.}`, `{/.}`) to prevent the shell from interpreting them before `fd` sees them. ## Integration with other programs