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

Re: Inconsistent history expansion of characters adjacent to histchar



On Oct 7,  7:56pm, Bart Schaefer wrote:
}
} In short, the history parser has always been very ad-hoc and deviates
} from its own spec in several ways.
} 
} Here's a patch that fixes the unintended expansion, but it doesn't fix
} the inconsistent behavior with !& !| et al.  There should probably be
} more method to this madness instead of multiple series of individual
} character comparisons.

Just to illustrate this further:

torch% print !\; print foo                
zsh: event not found: \
torch% \print bar
bar
torch% print !\; print foo                
print \print bar; print foo
print bar
foo
torch% 

I'm wondering if backslash ought to be treated specially in more of the
history code.  In particular:

torch% print !\!; print foo       
zsh: event not found: \!
torch% 

One might think one could use that form to search for a command line
that begins with a literal exclamation point, but no.



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