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

Odd bug with !?str?% history expansion

I just enabled banghist to play around with it for a bit, and as is so
common for me, I hit a bug within 3 minutes of enabling a new feature.
When using the !?str?% syntax to retrieve a word from history matching
str, if it has a backslash escaped space in it, and it was loaded from
the history file, PS2 is for some reason shown instead of the command
being run.

To reproduce:
% echo 'echo ninja\ bug' > zsh.test
% zsh -f
% fc -R zsh.test
% echo !?ninja?%
#pressing enter produces this result:
echo ninja\

#and instead pressing ctrl-c gives this result:
echo ninja\
#this happens no matter how many times you do it, at least while
#pressing ctrl-c since enter would insert it in history.
#now up-arrow so you get the test command, or just type it:
% echo ninja\ bug
ninja bug
% echo !?ninja?%
echo ninja\ bug
ninja bug

This time it works, but why? I didn't explore what happens with other
forms of quoting yet.
Reproduced the bug in quite current cvs and 4.3.6. I don't have any
problems when not using the %.

Mikael Magnusson

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