[lldb-dev] [Bug 26165] New: Support moving between words in prompt with ctrl+left/right

via lldb-dev lldb-dev at lists.llvm.org
Fri Jan 15 12:18:53 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26165

            Bug ID: 26165
           Summary: Support moving between words in prompt with
                    ctrl+left/right
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: ori at avtalion.name
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

As mentioned in the following mailing list thread, LLDB should have built-in
support for hotkeys for moving between words, specifically ctrl+left/right.

http://lists.llvm.org/pipermail/lldb-dev/2016-January/009271.html

This is a very common use-case, particularly useful when editing long lines of
text (such as when typing commands in the Swift REPL, based on LLDB). At the
moment, LLDB spits out ;5C and ;5D which causes even more problems, forcing you
to delete those errant characters.

These are the two bindings I'm suggesting, taken from my ~/.editrc:
 bind "\e[1;5C" em-next-word
 bind "\e[1;5D" ed-prev-word

These specific commands match how both Bash and Emacs handle ctrl+left/right.
Ctrl+right moves the cursor forward, stopping directly after the last letter of
the current word.
Ctrl+left moves the cursor back to the first letter of the closest word.

Vi's behavior is a bit different, always moving forward/back to the start of a
word. For "vi-mode", these seem to fit:
  bind "\e[1;5C" vi-next-word
  bind "\e[1;5D" vi-prev-word

(ed-prev-word and vi-prev-word call different functions in libedit, with
slightly different code, but behavior seems to be identical.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160115/97ba0166/attachment.html>


More information about the lldb-dev mailing list