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

[BUG?] - history word expansion for commands with interactive comments



Hello,

on a somewhat recent version of ZSH, it seems that the comment character is
considered part of the arguments of commands ending with a comment:

jbm gandia:~[1310]% zsh -f

gandia% echo $ZSH_VERSION
5.3.1

gandia% setopt interactive_comments

gandia% echo $histchars[3]
#

gandia% echo test # My comment sentence.
test

gandia% echo !:$
echo #

gandia% echo 'another test' ### Several commenting characters
another test

gandia% echo !:$
echo #

gandia% echo yet another test # My comment here
yet another test

gandia% echo !:*
echo yet another test #
yet another test


I would find it more helpful to have the commenting character not
considered part of the arguments, like bash does.

-- jbm


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