-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
0.56.1 broke fzf-history-widget completion in zsh 5.9 when share_history is enabled #4091
Comments
Just to confirm, you also tested Please share your options. unsetopt KSH_OPTION_PRINT
print -r -- $(setopt) Could you give me some guidance on the individual steps I need to take to see the issue? A minimal zsh version with a couple of steps ... command env -i HOME=$HOME TERM=$TERM USER=$USER PATH=$PATH zsh -f -o sharehistory
source <(fzf --zsh)
# press 'Control-R'
# ? |
I am experiencing this issue too.
in .zshrc
After commenting out the |
@ryanwi, does the issue disappear if you do the following:
In the meantime, this workaround will remove the source <(fzf --zsh | sed 's/fc -RI/true/') Footnotes |
Thanks very much @LangLangBart and @ryanwi. For me: pressing ⏎ Enter doesn’t help, but removing |
Thanks for the confirmation, could you test an earlier version of the Lines 116 to 118 in d938fdc
Just run: source <(curl -fsSL https://raw.githubusercontent.com/junegunn/fzf/d938fdc/shell/key-bindings.zsh) Footnotes |
Yes, d938fdc “works” (selected item appears on the zsh line) but has the problematic side-effect of heavily mutating the shell history every time fzf is used: changes the order and numbers of items in the history, and up-arrow takes me to the wrong (out of order) history lines. |
Thanks again for testing. I might propose reverting We could move Lines 113 to 130 in 215ab48
|
Hmm yeah, revert and re-open seems fair, given that it minimises the unresolved corner case and retains the overall functionality until a cleaner solution is found. |
Checklist
man fzf
)Output of
fzf --version
0.56.2 (brew)
OS
Shell
Problem / Steps to reproduce
This seems related to #4061:
I am using default
source <(fzf --zsh)
from macOS Homebrew with zsh 5.9 (x86_64-apple-darwin23.0) withsetopt share_history
enabled, but as of fzf version 0.56.1 the history completion with^R
bound tofzf-history-widget
is broken (last working version was 0.56.0). Previous behaviour in zsh was thatfoo^r^m
would return fzf’s default matching result forfoo
(e.g.found-history
) but now it returns my original input stringfoo
. In the simplest case of^r^m
the widget simply returns nothing (previously, it would have returned the fzf’s default selected item). Intermittently it does return a result, but rarely. Despite havingshare_history
enabled, I do not have a second shell using the history file; this issue is reproducible with a single shell on its own. (And unlike #4088 I’m not usingFZF_COMPLETION_TRIGGER
.) If I downgrade to 0.56.0 or disableshare_history
the previous expected behaviour is restored.The text was updated successfully, but these errors were encountered: