unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] trivial patch, jumping cursor in term
@ 2009-09-23 14:01 Ivan Kanis
  2009-09-24  1:41 ` Dan Nicolaescu
  2009-09-24  2:15 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Ivan Kanis @ 2009-09-23 14:01 UTC (permalink / raw)
  To: dann; +Cc: emacs-devel

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

Hello Dan,

Here are the steps to reproduce the bug:

M-x term
C-x 2
Input a character

You'll see the cursor move to the top left when it shouldn't. I have
tracked the problem to the following call stack.

term-emulate-terminal
term-check-size
term-set-scroll-region
term-set-scroll-region

The cursor should move when receiving ESC [ R, so I've added a parameter
to term-set-scroll-region which will move the cursor if set to t.

Could you, please, apply the patch?

Kind regards,
-- 
Ivan
Kanis http://kanis.fr

Think like a man of action, act like a man of thought.
    -- Henry Bergson 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: term-cursor.patch --]
[-- Type: text/x-diff, Size: 1001 bytes --]

diff -r b9b27a5565ff lisp/misc/term.el
--- a/lisp/misc/term.el	Wed Sep 23 15:50:43 2009 +0200
+++ b/lisp/misc/term.el	Wed Sep 23 15:52:10 2009 +0200
@@ -3377,10 +3377,11 @@
    ((eq char ?r)
     (term-set-scroll-region
      (1- term-terminal-previous-parameter)
-     (1- term-terminal-parameter)))
+     (1- term-terminal-parameter)
+     t))
    (t)))
 
-(defun term-set-scroll-region (top bottom)
+(defun term-set-scroll-region (top bottom &optional esc-bracket-r)
   "Set scrolling region.
 TOP is the top-most line (inclusive) of the new scrolling region,
 while BOTTOM is the line following the new scrolling region (e.g. exclusive).
@@ -3398,7 +3399,8 @@
 	    (not (and (= term-scroll-start 0)
 		      (= term-scroll-end term-height)))))
   (term-move-columns (- (term-current-column)))
-  (term-goto 0 0))
+  (if esc-bracket-r
+      (term-goto 0 0)))
 
 ;; (defun term-switch-to-alternate-sub-buffer (set)
 ;;   ;; If asked to switch to (from) the alternate sub-buffer, and already (not)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-09-28  6:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-23 14:01 [PATCH] trivial patch, jumping cursor in term Ivan Kanis
2009-09-24  1:41 ` Dan Nicolaescu
2009-09-24  2:15 ` Stefan Monnier
2009-09-24  6:46   ` Ivan Kanis
2009-09-24 15:02     ` Stefan Monnier
2009-09-24 17:11       ` Dan Nicolaescu
2009-09-25  8:56         ` Ivan Kanis
2009-09-25 14:29           ` Stefan Monnier
2009-09-28  6:30             ` Ivan Kanis

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).