mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Add support for more keyboard shortcuts (#410)
Add extra key bindings to the emacs and vi modes
This patch adds the following key bindings to the emacs and vi
editing modes:
- Support for Home key sequences ^[[1~ and ^[[7~ as well as End key
sequences ^[[4~ and ^[[8~.
- Support for arrow key sequences ^[OA, ^[OB, ^[OC and ^[OD.
- Support for the following keyboard shortcuts (if the platform
supports the expected escape sequence):
- Ctrl-Left Arrow: Go back one word
- Alt-Left Arrow: Go back one word (Not supported on Haiku)
- Ctrl-Right Arrow: Go forward one word
- Alt-Right Arrow: Go forward one word (Not supported on Haiku)
- Ctrl-G: Cancel reverse search
- Ctrl-Delete: Delete next word (Not supported on Haiku)
- Added a key binding for the Insert key, which differs in the
emacs and vi editing modes:
- In emacs mode, Insert escapes the next character.
- In vi mode, Insert will switch the editor to insert mode (like
in vim).
src/cmd/ksh93/edit/{emacs,vi}.c:
- Add support for the <M-Left> and <M-Right> sequences. Like in
bash and mksh, these shortcuts move the cursor one word backward
or forward (like the <Ctrl-Left> and <Ctrl-Right> shortcuts).
- Only attempt to process these shortcuts if the escape sequence
begins with $'\E[1;'.
src/cmd/ksh93/edit/vi.c:
- If the shell isn't doing a reverse search, insert the bell
character when Ctrl+G is input.
- Add the Ctrl-Delete shortcut as an alias of 'dw'. Calling
ed_ungetchar twice does not work for 'dw', so Ctrl-Delete was
implemented by using a vp->del_word variable.
Co-authored-by: Martijn Dekker <martijn@inlv.org>
This commit is contained in:
parent
9c313c7fe3
commit
9a5af738ef
6 changed files with 334 additions and 8 deletions
9
ANNOUNCE
9
ANNOUNCE
|
|
@ -56,6 +56,15 @@ New features in built-in commands:
|
|||
Note that to use these options the operating system must support the
|
||||
corresponding resource limit.
|
||||
|
||||
New command line editor features:
|
||||
|
||||
- Various keys on extended PC keyboards are now handled as expected in the
|
||||
emacs and vi built-in line editors: Ctrl or Alt + left or right arrow (go
|
||||
back or forward one word), Ctrl+G (cancel reverse search), Ctrl+Delete
|
||||
(delete next word). In addition, the Insert key now escapes the next
|
||||
character in emacs and enters insert mode in vi, and the arrow keys are
|
||||
recognized on more terminals.
|
||||
|
||||
New features in shell options:
|
||||
|
||||
- The new --histreedit and --histverify options modify history expansion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue