zsh-workers
 help / color / mirror / code / Atom feed
From: Leah Neukirchen <leah@vuxu.org>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh-workers@zsh.org
Subject: Re: History expansion surprisingly sets event designator
Date: Tue, 06 Jun 2017 18:54:57 +0200	[thread overview]
Message-ID: <874lvtcazi.fsf@vuxu.org> (raw)
In-Reply-To: <20170606174345.6f5b8f04@pwslap01u.europe.root.pri> (Peter Stephenson's message of "Tue, 06 Jun 2017 17:43:45 +0100")

Peter Stephenson <p.stephenson@samsung.com> writes:

> On Tue, 6 Jun 2017 17:50:03 +0200
> Leah Neukirchen <leah@vuxu.org> wrote:
>
>> Hi,
>> 
>> on #zsh we discovered:
>> 
>> zsh 5.3.1 (x86_64-unknown-linux-gnu)
>> zsh-5.3.1-0-g06b1b7a    (and zsh-5.3.1-204-g62c4169, via danielsh)
>> % zsh -f
>> juno% printf a b c
>> a%
>> juno% echo x y z
>> x y z
>> juno% echo !printf:2<TAB><DEL>!:3<RET>
>> c
>>
>> The first tab expansion will correctly expand to "b", but it changes
>> the event designator to the printf-line, resulting in !:3 expanding to "c",
>> while the typed in line "echo !:3" itself would refer to the previous
>> line, the echo-line, and should result in "z".
>> (Same for tab-expanding the second history reference.)
>> 
>> Pressing ^U will not reset this, but pressing ^C will.
>
> Yes, that's how it works.  I haven't understood why you think it's a
> problem but I presume you're used to some other shell.

If my command line is "echo !:3" before pressing RET, it should always
print z, even if I fiddled around with tab expansion during editing.
I think this is quite confusing as-is.

-- 
Leah Neukirchen  <leah@vuxu.org>  http://leah.zone


  reply	other threads:[~2017-06-06 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170606161125epcas2p251421009eed052386daeae65f8bfd810@epcas2p2.samsung.com>
2017-06-06 15:50 ` Leah Neukirchen
2017-06-06 16:43   ` Peter Stephenson
2017-06-06 16:54     ` Leah Neukirchen [this message]
2017-06-06 17:13       ` Peter Stephenson
2017-06-06 21:09         ` Leah Neukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lvtcazi.fsf@vuxu.org \
    --to=leah@vuxu.org \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).