Skip to content

Arrow keys to exit lldb's reverse history search inserts raw character while doing so #145715

Open
@DavidSpickett

Description

@DavidSpickett

OS Ubuntu 22.04.5 LTS, libedit installed from apt:

libedit-dev/jammy,now 3.1-20210910-1build1 arm64 [installed]
libedit2/jammy,now 3.1-20210910-1build1 arm64 [installed,automatic]

I expect that searching history in lldb would work as it does in my terminal:

  • ctrl+r enters (reverse-i-search)':`
  • I start searching and find the command I want
  • I want to edit that command before running, so I press an arrow key, usually right
  • That exits the search mode and leaves the cursor one to the right of where it was
$
<ctrl-r>
(reverse-i-search)`': 
<nin>
(reverse-i-search)`ninj': ninja
<right arrow>
$ ninja

When you do this in LLDB it exits the mode but the raw character code is inserted for right arrow, instead of making the cursor move:

(lldb) watchpoint set variable a
bck:set
<right arrow>
(lldb) watchpoint [Cset variable a

That [C is actually there it's not just a visual artifact:

(lldb) watchpoint [Cset variable a
"[Cset" is not a valid subcommand of "watchpoint". Valid subcommands are: command, delete, disable, enable, ignore, and others. Use "help watchpoint" to find out more.

We know that we should exit but not that it needs to be handled as a special character.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions