]> code.delx.au - gnu-emacs/commitdiff
Support absolute column movement in 'ansi-term'
authorVasilij Schneidermann <v.schneidermann@gmail.com>
Thu, 21 Apr 2016 15:59:37 +0000 (18:59 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 21 Apr 2016 15:59:37 +0000 (18:59 +0300)
* lisp/term.el (term-handle-ansi-escape): Handle the "\E[G" sequence
for absolute column movement.  (Bug#23303)

lisp/term.el

index 3520a3938e30aeb0acc5e2ffd82ac165ad691345..2d5d3e96000f0ed1a92fa5f328e7211c836edf28 100644 (file)
@@ -3260,6 +3260,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))