Skip to content
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

Executing shell history entry requires hitting Enter twice #2918

Closed
5 of 10 tasks
dwuertz opened this issue Aug 10, 2022 · 2 comments
Closed
5 of 10 tasks

Executing shell history entry requires hitting Enter twice #2918

dwuertz opened this issue Aug 10, 2022 · 2 comments

Comments

@dwuertz
Copy link

dwuertz commented Aug 10, 2022

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

When choosing a shell history item via Ctrl-R, I need to hit Enter once in order to insert it into the shell command line, and another time in order to execute it. It would improve the workflow if the shell integration could follow the behavior of the shell's built-in history handling which is something like this:
Hitting Enter once directly executes the search entry.
Hitting any command line navigation button such as left/right/home etc., the entry is inserted without immediate execution and cursor moved accordingly.

@junegunn
Copy link
Owner

It is by design. It gives us a chance to edit the command.

Related: #1492

@shmerl
Copy link

shmerl commented Jun 14, 2024

So far luckily this plugin still works: https://github.com/4z3/fzf-plugins/blob/master/history-exec.bash

But it might break over time. Is it possible to integrate something like this in fzf bash bindings itself?

Using Ctrl+E for edit and Enter for execute is really neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants