5

FZF is a lovely tool, the main issue I have is that the commands I end up running with it don't end up in my bash history.

Let's say I do this

history | fzf 

And I choose a command I ran recently, say echo "hello". When I then go through my bash history, my most recently run command isn't echo "hello", it's history | fzf. This means that I have to re-run the entire history | fzf and find the same echo "hello" command if I want to run it again.

Is there a way to force my selected command that I got by using fzf into my bash history?

2
  • 2
    Does using Ctrl+r not do this already? In mine Ctrl+r launches fzf on my history, and pressing enter on some old item pastes it to the terminal - if I run that command by pressing enter, then it shows up as the last item in the history Commented May 19, 2021 at 8:52
  • That is because you have not executed the hello command. You have merely printed that hello command out in your terminal. Your last executed command is history | fzf which shows in your history. Commented Nov 17, 2023 at 21:32

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.