From 81168edb1075a88ec0a3be27abedf8bcbbfa7c78 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 22 Feb 2026 12:39:12 +0200 Subject: [PATCH] Fix absolute cursor positioning in term.el * lisp/term.el (term-handle-ansi-escape): Cursor Character Absolute uses one-based column numbers; adjust to Emacs's zero-based column numbering. (Bug#80458) --- lisp/term.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/term.el b/lisp/term.el index 9ac77730350..15ba310a73a 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3698,7 +3698,7 @@ color is unset in the terminal state." (term-move-columns (- (max 1 (car params))))) ;; \E[G - cursor motion to absolute column (terminfo: hpa) ((eq char ?G) - (term-move-columns (- (max 0 (min term-width (car params))) + (term-move-columns (- (max 0 (1- (min term-width (car params)))) (term-current-column)))) ;; \E[J - clear to end of screen (terminfo: ed, clear) ((eq char ?J)