Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Odd bug with !?str?% history expansion
- X-seq: zsh-workers 28180
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Odd bug with !?str?% history expansion
- Date: Sat, 21 Aug 2010 02:56:04 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=ZF+yXjUVrHvi7tfxFhr6kaZG6u4Fin3yUn0G4mwGCRE=; b=nLZD+DyxHePNB8VmWC1oJ2WmiXeUUv0eJuQNyK7jRk8TlLhvumv9Nfo8wnTj6jYDt5 Q2swOqD2P5oRRVs4tqNdFlxKSZNG4cB5eM6zJzE7WknEkHVtlh0ITZ0PcO/N774s20wk PRqGsA7/H/ahCHGaIX4s3+/TrRtw9pNYFNI7U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=T0LpBNY/Dg3VB7JhOttkCdNq3q25pFN9EdJGjMYJ52eaEIfjaqdZIoy29GwgwDAaS1 4wINyT/T7jbexdlsnLt0zmzes90TYJSXC3vOMR2CnG4cdw3+YDRzGxwp0W7/Rdd2MyJz /nWLvG1OPqoJCKL2jB3zvZyoEPDY95vDzui8E=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author