* bug#16746: support ctrl-left, ctrl-right etc for term-mode
@ 2014-02-13 21:09 Per Bothner
2016-02-24 3:19 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Per Bothner @ 2014-02-13 21:09 UTC (permalink / raw)
To: 16746; +Cc: Jakub Jankiewicz
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
The attached patch translates ctrl-left, ctrl-right, ctrl-up, and ctrl-down
to the same escape sequences as xterm sends. This means among other things
that ctrl-left and ctrl-right get interpreted as backward-word and
forward-word
in readline.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
[-- Attachment #2: term-ctrl-arrow.patch --]
[-- Type: text/x-patch, Size: 1563 bytes --]
2014-02-13 Per Bothner <per@bothner.com>
* term.el: Translate C-left, C-right, C-up, C-down to
appropriate (xterm-compatible) escape sequences.
=== modified file 'lisp/term.el'
--- lisp/term.el 2014-01-22 10:29:23 +0000
+++ lisp/term.el 2014-02-13 20:17:22 +0000
@@ -887,6 +887,10 @@
(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)
@@ -1275,6 +1279,10 @@
(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~"))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-24 3:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 21:09 bug#16746: support ctrl-left, ctrl-right etc for term-mode Per Bothner
2016-02-24 3:19 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.