Up-arrow previous command completion in Bash

That’s what I do, but it doesn’t have the killer addition of preserving your spot in history after grabbing a line of code. E.g., in Julia, you can type:

julia> f() = 1
f (generic function with 1 method)

julia> g() = 2
g (generic function with 1 method)

julia> f

Then to get f() = 1 on the line, to execute it, then the magic is that at the next julia> prompt, will grab g() = 2.

Do zsh or fish do that? Is there magic to bring that into bash?

5 Likes