[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49323] Readline library does not support vi-m

From: Rik
Subject: [Octave-bug-tracker] [bug #49323] Readline library does not support vi-mode correctly
Date: Wed, 12 Oct 2016 18:06:19 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0


                 Summary: Readline library does not support vi-mode correctly
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Wed 12 Oct 2016 11:06:17 AM PDT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux



The Readline library supports both vi and emacs key bindings.  Emacs is the
default setting.  Readline can be configured for any application (not just
Octave) through the file ~/.inputrc.  In my file the first line is

set editing-mode vi

to switch all key bindings over to vi-compatible ones.

This works perfectly in tcsh (which I use) or in csh.  In Octave, however,
there is a problem switching between insert and command mode.  By default, a
new line should be in "insert" mode (set keymap vi-insert).  This allows one
to immediately start typing.  That part is correct in Octave.  When I type an
up-arrow, to get the command up-history, Octave/Readline should switch to
"command" mode and display the last line on the console.  Instead, Octave is
remaining in insert mode.  When I then type a left arrow to move one character
to the left, Octave pauses a bit and then deletes the last character and drops
into command mode.  To see what I mean, try adding 

set show-mode-in-prompt on

to ~/.inputrc and re-start Octave.

Now there will be an indication at the start of the line as to which mode the
Readline library is in.  For me, '+' indicates insert and ':' indicates
command.  I can verify the sequence above is exactly what is happening.

This is terribly annoying as I keep ending up with garbled commands. 
Incidentally, all of this is console behavior when run with --no-gui-libs. 
The issue has been present in Octave a long time as I've verified the behavior
back to 3.4.3.

Now, this may not actually be Octave's fault.  tcsh has it's own internal line
editing commands using bindkey so it may not be using the Readline library. 
If I start a bash shell, I find that the insert mode persists if I use an
up-arrow to call up-history.  Maybe Octave could be throwing a call to
rl_set_keymap at that point, if in vi mode.  But at least when I use the left
arrow key in Bash it moves the cursor, rather than causing a delete

In the end, maybe only the 'left arrow' issue is a true Octave problem.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]