all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vasilij Schneidermann <v.schneidermann@gmail.com>
To: 23303@debbugs.gnu.org
Subject: bug#23303: 24.5; [PATCH] term.el doesn't support absolute column movement
Date: Sun, 17 Apr 2016 01:09:24 +0200	[thread overview]
Message-ID: <CAPGgwWSxBww_FZ=PZxizfUuu2S1QNv57fE9rL1Y0w+krHbmPjA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

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.

[-- Attachment #2: 0001-Support-E-G-sequence-for-absolute-column-movement.patch --]
[-- Type: text/x-diff, Size: 927 bytes --]

From 2d089f7c2e48cb3c2e3b9edc51f095f2feffc7bd Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann <v.schneidermann@gmail.com>
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


             reply	other threads:[~2016-04-16 23:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-16 23:09 Vasilij Schneidermann [this message]
2016-04-21 16:01 ` bug#23303: 24.5; [PATCH] term.el doesn't support absolute column movement Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPGgwWSxBww_FZ=PZxizfUuu2S1QNv57fE9rL1Y0w+krHbmPjA@mail.gmail.com' \
    --to=v.schneidermann@gmail.com \
    --cc=23303@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.