mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Make `C-{up,down,left,right}' work in term mode
* lisp/term.el (term-raw-map): Define C-{up,down,left,right}
to send the same escape sequence that xterm sends. This makes
backward-word and forward-word work in readline (bug#16746).
This commit is contained in:
parent
70c3c79ec0
commit
6ef8c6ceb8
2 changed files with 12 additions and 0 deletions
|
|
@ -834,6 +834,10 @@ is buffer-local."
|
|||
(define-key map [down] 'term-send-down)
|
||||
(define-key map [right] 'term-send-right)
|
||||
(define-key map [left] 'term-send-left)
|
||||
(define-key map [C-up] 'term-send-ctrl-up)
|
||||
(define-key map [C-down] 'term-send-ctrl-down)
|
||||
(define-key map [C-right] 'term-send-ctrl-right)
|
||||
(define-key map [C-left] 'term-send-ctrl-left)
|
||||
(define-key map [delete] 'term-send-del)
|
||||
(define-key map [deletechar] 'term-send-del)
|
||||
(define-key map [backspace] 'term-send-backspace)
|
||||
|
|
@ -1217,6 +1221,10 @@ without any interpretation."
|
|||
(defun term-send-down () (interactive) (term-send-raw-string "\eOB"))
|
||||
(defun term-send-right () (interactive) (term-send-raw-string "\eOC"))
|
||||
(defun term-send-left () (interactive) (term-send-raw-string "\eOD"))
|
||||
(defun term-send-ctrl-up () (interactive) (term-send-raw-string "\e[1;5A"))
|
||||
(defun term-send-ctrl-down () (interactive) (term-send-raw-string "\e[1;5B"))
|
||||
(defun term-send-ctrl-right () (interactive) (term-send-raw-string "\e[1;5C"))
|
||||
(defun term-send-ctrl-left () (interactive) (term-send-raw-string "\e[1;5D"))
|
||||
(defun term-send-home () (interactive) (term-send-raw-string "\e[1~"))
|
||||
(defun term-send-insert() (interactive) (term-send-raw-string "\e[2~"))
|
||||
(defun term-send-end () (interactive) (term-send-raw-string "\e[4~"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue