Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
bug in replace-string: widget loses characters
- X-seq: zsh-users 17311
- From: Moritz Bunkus <moritz@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: bug in replace-string: widget loses characters
- Date: Mon, 8 Oct 2012 20:19:10 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bunkus.org; s=mail201203; t=1349720351; bh=uhsTDNXUJlmaQ+Q2nws9kvz7BUQQT6JIxl7M31MmHEk=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=E1BZwd3/FTctwLav4lAr9l9MBOJoENHkQxk1hzYA7n5hdX0MZybR2pQWECFg6jYEc rqXX2l9ogDSK5s2F3g3T5bK5/oWfcmZHesNAsyMuNf+StTgr80Xl21mLYnBG/jRtht kUD9euzkLyjpkvk8OmR1ycf1RzICdsna9okBCt6w=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hey,
zsh 5.0.0 on Arch Linux here. I'm using the replace-string widget and
have the problem that often it loses characters from the current input
when I use it. Not always, but often enough.
In order to demonstrate what I mean, do the following:
* Start zsh with --no-rcs:
sweet-chili% zsh --no-rcs
sweet-chili% zsh --version
zsh 5.0.0 (x86_64-unknown-linux-gnu)
* load the widget and bind it to a key, e.g. Alt-R:
sweet-chili% autoload replace-string
sweet-chili% zle -N replace-regex replace-string
sweet-chili% bindkey '^[r' replace-regex
* Next enter some text with several arguments, don't hit enter. In
this example I've used the following:
sweet-chili% somecmd 64/ubuntu/precise 64/ubuntu/quantal argab
* Hit Alt-R. Replace 64 with 32, and the result will be:
sweet-chili% somecmd 32/ubuntu/precise 32/ubuntu/quantal arga
Note that the "b" is missing at the end. Undo will not restore that
character, but it will turn the "32"s into "64"s again.
* It gets even weirder. Now hit "enter". The command will not be
found, obviously. Go one up in the history displaying the command
again and prefix it with "echo ". The result should look like this:
sweet-chili% echo somecmd 32/ubuntu/precise 32/ubuntu/quantal arga
* Hit Alt-R and replace 32 with 64 again. This time the space between
'echo' and 'somecmd' will be removed resulting in:
sweet-chili% echosomecmd 64/ubuntu/precise 64/ubuntu/quantal arga
Unlike after the first replacement the cursor will be after the "echo"
and not at the end of the line.
This unpredictable behavior makes using the widgets pretty pointless
(or at least highly frustrating), and I do think it qualifies to be
called a bug, doesn't it? ;)
Kind regards,
mosu
Messages sorted by:
Reverse Date,
Date,
Thread,
Author