This is achieved in bash by shopt -s histverify
I don't use history expansions, though, so YMMV
In zsh you can type !!<tab> and it will auto-expand the line for you. I find histverify to be kind of annoying so I don't use it.
Re:Advancing in the Bash Shell
by Something1234 on Friday September 16, 2016 @10:55AM
(#12514397)
How so?
I think by default in vanilla zsh, will expand something like 'sudo !!' by hitting tab after the second bang.
Re:Advancing in the Bash Shell
by HeadlessChild on Tuesday September 13, 2016 @05:27AM
(#12486612)
You are correct.
Re:Advancing in the Bash Shell
by ssebastianj on Tuesday September 13, 2016 @10:25AM
(#12488497)
Same behavior on zsh with prezto.
I use zsh (with oh-my-zsh) and when I type e.g. "sudo !!" and press enter, it doesn't execute the command, instead it expands the !!. Another enter will then actually execute it.
I believe it's default behavior for oh-my-zsh. At least, I don't recall manually changing this.