bugGNU Octave - Bugs: bug #39645, weird characters inserted when...

 
 

bug #39645: weird characters inserted when searching in readline

Submitter:  CarnĂ« Draug <carandraug>
Submitted:  Thu 01 Aug 2013 03:33:32 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 27 Feb 2014 01:44:09 PM UTC, comment #4: 

FYI: this should now be fixed with readline 6.3 released 2014-02-26.

Mike Miller <mtmiller>
Group Member
Thu 12 Sep 2013 01:13:06 PM UTC, comment #3: 

I've confirmed this as a bug in readline and reported it along with a patch:

https://lists.gnu.org/archive/html/bug-readline/2013-09/msg00001.html

I don't think there's anything we can do about it in Octave other than wait for patches to readline to trickle down.

As a workaround you can hit the arrow key twice very quickly.

Mike Miller <mtmiller>
Group Member
Fri 06 Sep 2013 03:51:50 AM UTC, comment #2: 

I believe this is the relevant readline feature that is triggering this bug:

http://git.savannah.gnu.org/cgit/readline.git/tree/isearch.c#n387

In short, the escape key terminates the interactive search mode. If other characters are read within a certain timeout, the escape character is sent again so that they total key combination is preserved. This is not happening in Octave.

I don't think this is a timeout problem, however. I made a hack to set the readline input timeout to a full second. Now it simply pauses for a second before displaying "[D" when I press the left arrow key.

Also if I type fast enough I can get readline to accept sequences beginning with escape while in the search mode, for example Esc u, but entering the Alt-u combination fails and just prints "u".

Mike Miller <mtmiller>
Group Member
Sun 04 Aug 2013 10:03:20 PM UTC, comment #1: 

This bug is triggered when any escape-prefixed keyboard key is pressed while in the readline interactive search mode (Ctrl-R). The escape character is lost somewhere and the rest of the characters are output verbatim. On my keyboard, this includes the four arrow keys, page up, page down, home, end, insert, and delete.

Both command-line Octave and the GUI terminal.

Mike Miller <mtmiller>
Group Member
Thu 01 Aug 2013 03:33:32 PM UTC, original submission:  

Using the readline feature to search history (Ctr+R), pressing up and down to move between the logs work fine. However, after finding the desired line, using the left or right arrow to move in that line, inserts the [C or [D characters forcing to remove them manually. This does not happen in the shell.

Here's how to reproduce:

1. press Ctr+R to start searching the log
2. press left arrow to move on that line
3. the characters "[D" will be inserted

If the right arrow is pressed, "[C" is inserted instead.

Carnë Draug <carandraug>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jordigh (Updated the item)
  • -email is unavailable- added by carandraug (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-17 rik5 StatusConfirmed Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2013-08-04 mtmiller Item GroupNone Incorrect Result
    2013-08-01 jordigh StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code