zsh-workers
 help / color / mirror / code / Atom feed
* Odd bug with !?str?% history expansion
@ 2010-08-21  0:56 Mikael Magnusson
  2010-09-25 19:23 ` Mikael Magnusson
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2010-08-21  0:56 UTC (permalink / raw)
  To: zsh workers

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\

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


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

* Re: Odd bug with !?str?% history expansion
  2010-08-21  0:56 Odd bug with !?str?% history expansion Mikael Magnusson
@ 2010-09-25 19:23 ` Mikael Magnusson
  0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2010-09-25 19:23 UTC (permalink / raw)
  To: zsh workers

This seems to be fixed by 28295.

On 21 August 2010 02:56, Mikael Magnusson <mikachu@gmail.com> wrote:
> 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\
>
> 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


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

end of thread, other threads:[~2010-09-25 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-21  0:56 Odd bug with !?str?% history expansion Mikael Magnusson
2010-09-25 19:23 ` Mikael Magnusson

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).