junegunn / junegunn/fzf

`FZF_DEFAULT_COMMAND` breaks when `SHELL` set to `pwsh`

Open
#3,296 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
83k
Forks
2.9k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

- [x] I have read through the manual page (`man fzf`)
- [x] I have the latest version of fzf
- [x] I have searched through the existing issues

## Info

- OS
- [x] Linux
- [ ] Mac OS X
- [x] Windows
- [ ] Etc.
- Shell
- [ ] bash
- [ ] zsh
- [ ] fish
- [x] pwsh

## Problem / Steps to reproduce
When `$env:SHELL` or `$SHELL` is set to `pwsh -NoLogo` on _Windows_ or `/usr/bin/pwsh` on _*nix_ ( in my case it is _RHEL 9_ ), usage like
```powershell
$env:FZF_DEFAULT_COMMAND = 'fd.exe'
fzf
```
fails with _command failed_.

I have even tried
```powershell
$env:SHELL = 'pwsh -NoLogo -NoProfile -ExecutionPolicy Bypass -NonInteractive -InputFormat Text -OutputFormat Text -Command'
```
on _Windows_ and it still fails.
### Workaround
On _Windows_ set `$env:SHELL = 'cmd.exe'`. On _*nix_ running `pwsh`, do `$env:SHELL = '/usr/bin/bash'` or the like.

### Workaround Update
On `pwsh` version _7.3.8_, setting `$env:SHELL = 'pwsh'` does work now. It seems adding parameters will break `fzf` usage on _Windows_.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with FZF_DEFAULT_COMMAND set to fd.exe and SHELL set to pwsh with and without parameters on Windows and *nix. Compare the behavior with the documented cmd.exe or bash workarounds; done means the supplied command works under the reported pwsh configurations without requiring those workarounds.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, powershell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.