Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: history expansion



I use history substitution all the time. I'm occasionally annoyed by the need to extra-quote exclamation points, but not enough to give up the feature, which you can always turn off with unsetopt banghist.

Erik: the confirmation you're getting is controlled by the histverify option. 

On Sun, Jul 12, 2026 at 6:39 AM Erik Wybouw <erik.wybouw@xxxxxxxxx> wrote:
I use it a lot (coming from tcsh where I developed the muscle memory for it).

ZLE (at least mine, but can’t immediately find the option) can expand the line for you as you hit enter, requiring a second confirmation enter to actually execute, so that helps, and I’ve taken the habit of tab-expanding ‘!’ constructs myself immediately as I type the line.

ps: also unclear where that tab is coming from, as I have expand-history only bound to ESC prefixed combinations.

Kind regards, erik.
Erik Wybouw



On 12 Jul 2026, at 10:57, Vincent Lefevre <vincent@xxxxxxxxxx> wrote:

I'm wondering whether users use history expansion in practice, as it
does not seem to be very useful with the power of ZLE (I suppose that
one can do the same kind of things, with the advantage of seeing the
immediate effect).

It can have a surprising behavior. For instance, after "zsh -f":

qaa% echo "foo!"
dquote>

Note that bash does not have any issue here. But there is the same
behavior with the less common

 echo "foo!!"

--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)




--
Mark J. Reed <markjreed@xxxxxxxxx>


Messages sorted by: Reverse Date, Date, Thread, Author