zsh-workers
 help / color / mirror / code / Atom feed
* quoting of !'s in print -s: not!
@ 1996-07-15  9:45 Peter Stephenson
  1996-07-19  0:54 ` Zoltan Hidvegi
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 1996-07-15  9:45 UTC (permalink / raw)
  To: Zsh hackers list

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.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: quoting of !'s in print -s: not!
  1996-07-15  9:45 quoting of !'s in print -s: not! Peter Stephenson
@ 1996-07-19  0:54 ` Zoltan Hidvegi
  0 siblings, 0 replies; 2+ messages in thread
From: Zoltan Hidvegi @ 1996-07-19  0:54 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-07-19  1:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-15  9:45 quoting of !'s in print -s: not! Peter Stephenson
1996-07-19  0:54 ` Zoltan Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).