From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21259 invoked by alias); 8 Oct 2012 18:19:14 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17311 Received: (qmail 14180 invoked from network); 8 Oct 2012 18:19:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bunkus.org does not designate permitted sender hosts) 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= MIME-Version: 1.0 Date: Mon, 8 Oct 2012 20:19:10 +0200 Message-ID: Subject: bug in replace-string: widget loses characters From: Moritz Bunkus To: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 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