diff options
Diffstat (limited to 'lisp/term.el')
-rw-r--r-- | lisp/term.el | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/lisp/term.el b/lisp/term.el index 993e5803059..5177ab4b921 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -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) @@ -1098,17 +1102,6 @@ Entry to this mode runs the hooks on `term-mode-hook'." (term-reset-size (cdr size) (car size))) size)) - ;; Without the below setting, term-mode and ansi-term behave - ;; sluggishly when the buffer includes a lot of whitespace - ;; characters. - ;; - ;; There's a larger problem here with supporting bidirectional text: - ;; the application that writes to the terminal could have its own - ;; ideas about displaying bidirectional text, and might not want us - ;; reordering the text or deciding on base paragraph direction. One - ;; such application is Emacs in TTY mode... FIXME. - (setq bidi-paragraph-direction 'left-to-right) - (easy-menu-add term-terminal-menu) (easy-menu-add term-signals-menu) (or term-input-ring @@ -1219,6 +1212,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~")) @@ -1250,6 +1247,11 @@ intervention from Emacs, except for the escape character (usually C-c)." (end-of-line) (term-send-input)) (setq term-input-sender save-input-sender)))) + + ;; Turn off XTerm bracketed paste (Bug#24639). + (when (fboundp 'xterm-inhibit-bracketed-paste-mode) + (xterm-inhibit-bracketed-paste-mode)) + (term-update-mode-line))) (defun term-line-mode () @@ -1259,6 +1261,8 @@ you type \\[term-send-input] which sends the current line to the inferior." (interactive) (when (term-in-char-mode) (use-local-map term-old-mode-map) + (when (fboundp 'xterm-inhibit-bracketed-paste-mode) + (xterm-inhibit-bracketed-paste-mode 0)) (term-update-mode-line))) (defun term-update-mode-line () @@ -3254,6 +3258,10 @@ See `term-prompt-regexp'." ;; \E[D - cursor left (terminfo: cub) ((eq char ?D) (term-move-columns (- (max 1 term-terminal-parameter)))) + ;; \E[G - cursor motion to absolute column (terminfo: hpa) + ((eq char ?G) + (term-move-columns (- (max 0 (min term-width term-terminal-parameter)) + (term-current-column)))) ;; \E[J - clear to end of screen (terminfo: ed, clear) ((eq char ?J) (term-erase-in-display term-terminal-parameter)) |