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

Re: exclamation mark expansion in shell command

On Oct 8, 11:36am, Heinrich Götzger wrote:
} On Wed, 2 Oct 2002, Bart Schaefer wrote:
} > zsh% !" echo !foo
} > !foo
} >
} > Note that in all versions of zsh less than 4.1.0, the "magic-space" key
} > binding ignores the !" and still causes history to expand as you type.
} > (In fact, it'll erase the !" as soon as you type the space after it.)
} I'm using zsh 4.0.2 on Linux and if I type the line from the beginning,
} the described behavior occures. But If I edit the command line in a way
} that I add the !" at the beginning after typing the rest works as well.

Just to clarify ...

Yes, you can add the !" after the fact to avoid having it removed by
magic-space.  However, whether or not the !" is present, magic-space will
attempt to expand every history reference on the line if at any time you
type a space (and you're using the magic-space binding, obviously).

This has been fixed in 4.1.0-dev* so that magic-space recognizes when a
leading !" is present and does not expand history in that case.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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