Subject: bug#23303: closed (Re: bug#23303: 24.5; [PATCH] term.el doesn't support absolute column movement)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 21 Apr 2016 16:02:01 +0000

Your bug report

#23303: 24.5; [PATCH] term.el doesn't support absolute column movement

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
23303: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23303
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#23303: 24.5; [PATCH] term.el doesn't support absolute column movement
From: Eli Zaretskii <[email-masked]>
To: Vasilij Schneidermann <[email-masked]>
Cc: [email-masked]
Date: Thu, 21 Apr 2016 19:01:11 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Sun, 17 Apr 2016 01:09:24 +0200
> From: Vasilij Schneidermann <[email-masked]>
> 
> While testing out a program I noticed it was misbehaving in M-x
> ansi-term for the commands using the \e[0G sequence for moving the
> cursor to column 0.  Apparently this is because it doesn't have any code
> branch in `term-handle-ansi-escape' for this case.  I've attached a
> patch to fix this deficiency.

Thanks, installed on master.

Subject: 24.5; [PATCH] term.el doesn't support absolute column movement
From: Vasilij Schneidermann <[email-masked]>
To: [email-masked]
Date: Sun, 17 Apr 2016 01:09:24 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

While testing out a program I noticed it was misbehaving in M-x
ansi-term for the commands using the \e[0G sequence for moving the
cursor to column 0.  Apparently this is because it doesn't have any code
branch in `term-handle-ansi-escape' for this case.  I've attached a
patch to fix this deficiency.
From 2d089f7c2e48cb3c2e3b9edc51f095f2feffc7bd Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann <[email-masked]>
Date: Sun, 17 Apr 2016 00:58:52 +0200
Subject: [PATCH] Support \E[G sequence for absolute column movement

---
 lisp/term.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/term.el b/lisp/term.el
index ecaca50..3bc934e 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -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))
-- 
2.8.0