Re: history expansion

"Mark J. Reed" <[email protected]> Sun, 12 Jul 2026 09:36:36 -0400
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <CAA=-s3xAjkK1jcQ+zJFqNgF_1xkezLudrnenjttGxoZPMsUf0g@mail.gmail.com>
--000000000000d3314406566a10fb
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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=E2=80=AFAM Erik Wybouw <[email protected]>=
 wrote:

> I use it a lot (coming from tcsh where I developed the muscle memory for
> it).
>
> ZLE (at least mine, but can=E2=80=99t immediately find the option) can ex=
pand the
> line for you as you hit enter, requiring a second confirmation enter to
> actually execute, so that helps, and I=E2=80=99ve taken the habit of tab-=
expanding
> =E2=80=98!=E2=80=99 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.
> =E2=80=94
> Erik Wybouw
>
>
>
> On 12 Jul 2026, at 10:57, Vincent Lefevre <[email protected]> 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=C3=A8vre <[email protected]> - 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)
>
>
>

--=20
Mark J. Reed <[email protected]>

--000000000000d3314406566a10fb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I use history substitution all the time. I&#39;m occasiona=
lly annoyed by the need to extra-quote exclamation points, but not enough t=
o give up the feature, which you can always turn off with <b>unsetopt bangh=
ist</b>.<div><br></div><div>Erik: the confirmation=C2=A0you&#39;re getting =
is controlled by the <b>histverify </b>option.=C2=A0</div></div><br><div cl=
ass=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_a=
ttr">On Sun, Jul 12, 2026 at 6:39=E2=80=AFAM Erik Wybouw &lt;<a href=3D"mai=
lto:[email protected]">[email protected]</a>&gt; wrote:<br></div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le=
ft:1px solid rgb(204,204,204);padding-left:1ex"><div>I use it a lot (coming=
 from tcsh where I developed the muscle memory for it).<div><br><div>ZLE (a=
t least mine, but can=E2=80=99t immediately find the option) can expand the=
 line for you as you hit enter, requiring a second confirmation enter to ac=
tually execute, so that helps, and I=E2=80=99ve taken the habit of tab-expa=
nding =E2=80=98!=E2=80=99 constructs myself immediately as I type the line.=
</div><div><br></div><div>ps: also unclear where that tab is coming from, a=
s I have expand-history only bound to ESC prefixed combinations.</div><div>=
<br></div><div>Kind regards, erik.<br id=3D"m_1546323371331051449lineBreakA=
tBeginningOfMessage"><div>
=E2=80=94<div>Erik Wybouw<br><br><br></div>
</div>
<div><br><blockquote type=3D"cite"><div>On 12 Jul 2026, at 10:57, Vincent L=
efevre &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">vincent@=
vinc17.net</a>&gt; wrote:</div><br><div><div>I&#39;m wondering whether user=
s use history expansion in practice, as it<br>does not seem to be very usef=
ul with the power of ZLE (I suppose that<br>one can do the same kind of thi=
ngs, with the advantage of seeing the<br>immediate effect).<br><br>It can h=
ave a surprising behavior. For instance, after &quot;zsh -f&quot;:<br><br>q=
aa% echo &quot;foo!&quot;<br>dquote&gt;<br><br>Note that bash does not have=
 any issue here. But there is the same<br>behavior with the less common<br>=
<br> =C2=A0echo &quot;foo!!&quot;<br><br>-- <br>Vincent Lef=C3=A8vre &lt;<a=
 href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a=
>&gt; - Web: &lt;<a href=3D"https://www.vinc17.net/" target=3D"_blank">http=
s://www.vinc17.net/</a>&gt;<br>100% accessible validated (X)HTML - Blog: &l=
t;<a href=3D"https://www.vinc17.net/blog/" target=3D"_blank">https://www.vi=
nc17.net/blog/</a>&gt;<br>Work: CR INRIA - computer arithmetic / Pascaline =
project (LIP, ENS-Lyon)<br><br></div></div></blockquote></div><br></div></d=
iv></div></blockquote></div><div><br clear=3D"all"></div><div><br></div><sp=
an class=3D"gmail_signature_prefix">-- </span><br><div dir=3D"ltr" class=3D=
"gmail_signature">Mark J. Reed &lt;<a href=3D"mailto:[email protected]" t=
arget=3D"_blank">[email protected]</a>&gt;<br></div>

--000000000000d3314406566a10fb--