z4h-fzf-history widget fails with special characters in command history
LangLangBart opened this issue · 2 comments
LangLangBart commented
When a user runs the command below and executes the z4h-fzf-history
widget, an error is encountered.
To reproduce:
- Run
fc -p =(print -r -- 'echo デ')
- Press ⌃ Control + R to execute the
z4h-fzf-history
widget - Notice the error
z4h-fzf-history:133: no matches found: echo \M-c\n
Possible solution
Prepending noglob
or unsetting either the nomatch
or glob
option prevents the error.
--- a/fn/z4h-fzf-history
+++ b/fn/z4h-fzf-history
@@ -131,5 +131,5 @@ local preview='printf "%s" {} | command cut -f2- -d'$'\1'
unsetopt pipe_fail
{
- (( $#history )) && printf '%s\000' "${history[@]}"
+ (( $#history )) && noglob printf '%s\000' "${history[@]}"
} | {
{
Related: junegunn/fzf#3855
romkatv commented
Thanks!
romkatv commented
I reported this zsh bug upsteam: https://www.zsh.org/mla/workers/2024/msg00513.html