From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3460 invoked from network); 11 Mar 2001 10:45:38 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 Mar 2001 10:45:38 -0000 Received: (qmail 6323 invoked by alias); 11 Mar 2001 10:45:29 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3656 Received: (qmail 6312 invoked from network); 11 Mar 2001 10:45:28 -0000 Date: Sun, 11 Mar 2001 12:35:54 +0200 From: "Nadav Har'El" To: Andrej Borsenkow Cc: "Zvi Har'El" , ZSH Users Subject: Re: History Up key Message-ID: <20010311123554.A13168@leeor.math.technion.ac.il> References: <001801c0aa12$40465be0$21c9ca95@mow.siemens.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <001801c0aa12$40465be0$21c9ca95@mow.siemens.ru>; from Andrej.Borsenkow@mow.siemens.ru on Sun, Mar 11, 2001 at 01:01:33PM +0300 Hebrew-Date: 16 Adar 5761 On Sun, Mar 11, 2001, Andrej Borsenkow wrote about "RE: History Up key": > > I am using vi key binding. When I want to repeare my repeat command, I used > > to hit the "cursor-up" key, see the last command and hit enter. The > > fact that I > > am at vi-insert-mode still allowed the binding of "cursor-up" to > > "up-line-or-history". > > > > However, upgrading to zsh 4, the binding apparently disappeared, > > bindkey -M viins $terminfo[kcuu1] up-line-or-history >.. > I believe, change was deliberate, but I forgot the reasons ... it was really > long time - I think over three years. And I switched over to emacs binding > long ago (but have been using something similar before). I was also bit by this change. I've been using zsh for about 7 years now, and this hasn't been changed 3 years ago - at least not in the 3.0.8 version that is distributed with current Linux versions and which I've been using lately (perhaps it was changed in the 3.1.* betas - I don't know). In zsh 3.0.8 I have installed on my Redhat 7 machine, I get $ bindkey ... "^[[A" up-line-or-history ... [note that the above "bindkey" command showed the main keymap, which was vi insert mode because I had a "bindkey -v" or set VISUAL in my .zshrc or .zprofile] Anyway, I wonder what actually happens in the current version (4.0.1-pre-2) - when I type a few characters after the prompt and then change my mind, and press an up-arrow, it used to move me to the previous line (similar to to the effect of ESC-k-a, in vi mode - in very old versions I seem to remember it was more like ESC-k, without the a). Now it seamingly does nothing, but actually does something that prevents me from backspacing over the last characters I typed (this has the effect similar to ESC-a in vi mode, i.e., go to command mode and then return to insert mode). I think I understand why the unbound up-arrow behaves as strangely as it does: The up-arrow is (at least on my "screen" pseudo-terminal) simply ^[[A (ESC-[-A), which goes to command mode, does nothing (or whatever '[' does) and then returns to insert mode at the end of the line. I see absolutely no reason why anybody would find this new behavior useful - perhaps someone can enlighten me? Anyway, if the new behavior isn't useful, and the previous one is (or at least useful for backward-compatibility's sake), then maybe the above mapping for insert-mode should be returned to be the default? > Anyway, in vi mode (bindkey -v) you have two keymaps - viins (for input) and > vicmd (for command mode). To change key binding use 'bindkey -M ' Oh, I see the bindkey syntax and semantics changed considerably since the 3.0.* versions... Previously you had two unnamed maps: the "main map" (used for vi insert mode) and "alternate map" (used for vi command mode). Thanks, Nadav. -- Nadav Har'El | Sunday, Mar 11 2001, 16 Adar 5761 nyh@math.technion.ac.il |----------------------------------------- Phone: +972-53-245868, ICQ 13349191 |Computers are like air conditioners. http://nadav.harel.org.il |Both stop working if you open windows.