Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: quoting of !'s in print -s: not!
- X-seq: zsh-workers 1702
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: pws@xxxxxx (Peter Stephenson)
- Subject: Re: quoting of !'s in print -s: not!
- Date: Fri, 19 Jul 1996 02:54:42 +0200 (MET DST)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <199607150945.LAA00445@xxxxxxxxxxxx> from Peter Stephenson at "Jul 15, 96 11:45:07 am"
> Somebody pointed this out to me a short while ago and I ought to
> report it: print -s doesn't quote bangs correctly (indeed at all).
>
> % print -s echo \!hello\!
> <up-arrow>
> % echo !hello!
> zsh: event not found: hello!
>
> I suspect if anybody is going to alter this it will be Zoltan. I
> don't now how easy it is.
It is not too easy. One solution is to use doespandhist() with !"
prepended to the string we are adding to the history (the lexer is
unavoidable here since only unquoted bangs should be quoted and '!'
shouldn't). For that we have to save/restore several zle variables to
avoid surprises when print is called while zle is active. I think it is
not really a bug. What happens is the given arguments are added to the
history unchanged. Quoting may be undesirable sometions. E.g. single ! or
!= operators look better if they are left unquoted.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author