[Bash, gnome terminal] Ctrl+r displaying completions but pressing "enter" does nothing
- Category
- [ ] fzf binary
- [ ] fzf-tmux script
- [x] Key bindings
- [x] Completion
- [ ] Vim
- [ ] Neovim
- [ ] Etc.
- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Windows Subsystem for Linux
- [ ] Etc.
- Shell
- [x] bash
- [ ] zsh
- [ ] fish
Hello there,
I think the title describes the problem pretty well, here is a screenshot of what I get pressing ctrl+r :

But when I press the "enter" key with an option selected, the menu disappears and nothing happens.
Thanks for your help !
I'm having the same issue on macOS.
I can't reproduce the issue. I suggest that you start bash with a minimal configuration file with only one line
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
and see if you still have the issue. If you don't, then you need to find the culprit in your config.
You were right. In case it helps anyone, in my config the culprit was an alias for the history command itself that screwed with the functionality.
@dieterdemeyer Okay, if that was the case, we can ensure that the original history command is executed like so
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index be24dec..cb86e98 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -55,7 +55,7 @@ __fzf_history__() (
local line
shopt -u nocaseglob nocasematch
line=$(
- HISTTIMEFORMAT= history |
+ HISTTIMEFORMAT= command history |
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS --tac --sync -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS +m" $(__fzfcmd) |
command grep '^ *[0-9]') &&
if [[ $- =~ H ]]; then
OS: MacOS catalina Shell: Bash Terminal Emulator: both iterm, terminal Feature: history fuzzy search
I'm having a similar related issue concerning Ctrl+r for history, except I'm using aliases. (I prefer not remembering too many keyboard shortcuts.)
The issue thats occurring is:
using ctr-r for history works fine and copies the selection back to the prompt
However, if I decide to use a keyboard alias to call the history function __fzf_history__:
alias fzfhistory="__fzf_history__"
the interactive fuzzy finder works, however selecting the result from fzf no longer returns back the text, instead I get back to stdout the line number from history.

I had the same issues on MacOs using zsh. It worked with a simple .zshrc file so I was able to identify that settings:
setopt SHARE_HISTORY
prevents somehow fzf from returning to the prompt the selected command when pressing Enter.
Edit: just saw this discussion here.
prevents somehow
fzffrom returning to the prompt the selected command when pressing Enter.
The specific issue you mentioned for zsh should be fixed in the latest release, 0.56.3.