-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__fz_filter() fail on Bash #27
Comments
This is the same as #29 ?! |
Hi, @Konfekt I issued #27 after #25. git log -1 --oneline 2a4c1bc
#=> 2a4c1bc Merge pull request #25 from mike182uk/fzf-tmux
git diff 2a4c1bc...HEAD -- fz.sh
#=> (null) sorry, I do not use fz.sh lately. which fzf #=> ~/bin/fzf
mkdir ~/.bash_completion.d
cp ~/repo/rupa/z/master/z.sh ~/.bash_completion.d/
cp ~/repo/changyuheng/fz/fz.sh ~/.bash_completion.d/zfz.sh
source ~/.bash_completion.d/z.sh
source ~/.bash_completion.d/zfz.sh apply e096093 to fz.sh work fine for me, both terminal and tmux-pane.
|
Somewhat offtopic: For some reason, directory completion works for me in ZSH only with |
sorry, I missunderstand. bash -c 'fzf="date"; eval "fzf" ' #=> invoke fzf, appear fzf-window
bash -c 'fzf="date"; eval "$fzf" ' #=> Fri Oct 27 11:22:33 JST 2023
zsh -c 'fzf="date"; eval "fzf" ' #=> ditto. appear fzf-window
zsh -c 'fzf="date"; eval "$fzf" ' #=> ditto.
# command with option separated space
bash -c 'fzf="date +%j-%Y"; eval "$fzf" ' #=> 300-2023
zsh -c 'fzf="date +%j-%Y"; eval "$fzf" ' #=> ditto.
bash -c 'fzf="date +%j-%Y"; $fzf ' #=> ditto. word-split works.
zsh -c 'fzf="date +%j-%Y"; ${=fzf} ' #=> ditto. ${=spec} works. |
Thank you for check issue #26.
I use bash, not familiar with zsh.
Bash don't have word split Parameter Expansion ${=SPEC} syntax.
$ /bin/bash -c 'fzf="fzf-tmux arg1"; echo ${=fzf}'
#=> /bin/bash: ${=fzf}: bad substitution
$ /usr/bin/zsh -c 'fzf="fzf-tmux arg1"; echo ${=fzf}'
#=> fzf-tmux arg1
When fz.sh call __fz_filter(), bash cannot expand ${=fzf} and fail to open fzf window
$ bash --norc
export LANG=C
. ~/.fzf.bash
. ~/.bash_completion/z.sh
. ~/.bash_completion/fz.sh
mv ~/.z{,_bak_bash44}
cd ~/.cargo/bin
cd ~/bin
cd /bin
cd /usr/bin
cd /tmp
z bi[TAB]
#=> ERROR; bash-4.4$ z bibash: ${=fzf}: bad substitution
exit
$ zsh -f
export LANG=C
source ~/.bash_completion/z.sh
source ~/.bash_completion/fz.sh
mv ~/.z{,_bak_zsh501}
cd ~/.cargo/bin
cd ~/bin
cd /bin
cd /usr/bin
cd /tmp
z bi[TAB]
#=> SUCCESS; fzf window appear, select and path completion ok.
exit
My OS and Fzf is old.
But when fz.sh L:173 s/${=fzf}/${fzf}/, __fz_filter() work well in tmux session.
The text was updated successfully, but these errors were encountered: