junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
65.81k stars 2.41k forks source link

Selecting entry from Ctrl+R doesn't place it on the cmd line if $HISTSIZE is set #4095

Closed timothyfroehlich closed 1 week ago

timothyfroehlich commented 1 week ago

Checklist

Output of fzf --version

0.56.2 (brew)

OS

Shell

Problem / Steps to reproduce

https://github.com/user-attachments/assets/fcee678b-95e0-4eca-91b0-5345fce400bc

This just started happening a couple days ago without any changes to my .zshrc. If I press ctrl+R and select an entry by pressing enter I get a fresh cmd line. I went through my .zshrc until I found the line that caused the problem, which seems to be HISTSIZE=1000.

Here's the portion of my .zshrc that's related to history:

HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=$HISTSIZE
setopt appendhistory
setopt share_history #share history between multiple instances of zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

Unsetting HISTSIZE or SAVEHIST doesn't seem to help, only opening a new shell without HISTSIZE set.

Please let me know if there's anything else I can add to help debug.

LangLangBart commented 1 week ago

Should be fixed for the dev version. Ref: #4091

The current workaround until a new release is published is:

source <(fzf --zsh | sed 's/fc -RI/true/')

Sorry for the inconvenience.

junegunn commented 1 week ago

Should be fixed in 0.56.3.