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


bug #39645: weird characters inserted when searching in readline

Submitted by:  CarnĂ« Draug <carandraug>
Submitted on:  Thu 01 Aug 2013 03:33:32 PM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project Administrator
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:


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>
Project Administrator
Fri 06 Sep 2013 03:51:50 AM UTC, comment #2:

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


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>
Project Administrator
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>
Project Administrator
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>
Project Member


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

Attach Files:

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)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Thu 17 Oct 2013 09:56:07 PM UTC rik5 StatusConfirmed => Invalid
        Open/ClosedOpen => Closed
    Sun 04 Aug 2013 10:03:20 PM UTC mtmiller Item GroupNone => Incorrect Result
    Thu 01 Aug 2013 03:54:33 PM UTC jordigh StatusNone => Confirmed

    Back to the top

    Powered by Savane 3.3