Open mattcargile opened 1 year ago
@mattcargile I am encountering the same issue. Have you been able to diagnose the underlying mechanism(s)? If not, could you share any promising leads that you think I could build on to troubleshoot myself?
@mattcargile I am encountering the same issue. Have you been able to diagnose the underlying mechanism(s)? If not, could you share any promising leads that you think I could build on to troubleshoot myself?
I'm not sure how to debug it unless you understand the fzf
source and how it uses that environment variable.
On pwsh
version 7.3.8, I did just try setting $env:SHELL = 'pwsh'
and it does work. Adding the parameters is what breaks it. Maybe try it without parameters?
Ah, that explanation seems likely. I've run into issues with Windows treating things like that as a command name (i.e. just the resolvable name of an executable) rather than a command invocation/expression (i.e. to be parsed into a command to execute and arguments to pass to it).
Does fzf have any mechanism to specify a default command for shell invocations that fzf will take care of parsing/interpreting itself? (analogous to the currently-supported environment variables FZF_DEFAULT_COMMAND
, FZF_CTRL_T_COMMAND
, etc.)
Ah, that explanation seems likely. I've run into issues with Windows treating things like that as a command name (i.e. just the resolvable name of an executable) rather than a command invocation/expression (i.e. to be parsed into a command to execute and arguments to pass to it).
Does fzf have any mechanism to specify a default command for shell invocations that fzf will take care of parsing/interpreting itself? (analogous to the currently-supported environment variables
FZF_DEFAULT_COMMAND
,FZF_CTRL_T_COMMAND
, etc.)
I looked briefly at the README.md
and didn't see anything. I might try creating a bat
or cmd
file as your $env:SHELL
to get the features you want?
Additionally, after looking at source, if you have pwsh
or powershell
in your $env:SHELL
the command executed is altered and -NoProfile -Command
is added. It doesn't appear like fzf
is designed for this particular use case. No matter what, on Windows, at least -c
added to your $Env:SHELL
.
man fzf
)Info
Problem / Steps to reproduce
When
$env:SHELL
or$SHELL
is set topwsh -NoLogo
on Windows or/usr/bin/pwsh
on *nix ( in my case it is RHEL 9 ), usage likefails with command failed.
I have even tried
on Windows and it still fails.
Workaround
On Windows set
$env:SHELL = 'cmd.exe'
. On *nix runningpwsh
, 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 breakfzf
usage on Windows.