GNU bug report logs - #24124
emacs terminal escape command error

Previous Next

Package: emacs;

Reported by: modem <modem <at> member.fsf.org>

Date: Mon, 1 Aug 2016 15:03:02 UTC

Severity: normal

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: modem <modem <at> member.fsf.org>
Cc: 24124 <at> debbugs.gnu.org
Subject: bug#24124: emacs terminal escape command error
Date: Mon, 01 Aug 2016 18:18:02 +0300
> From: modem <modem <at> member.fsf.org>
> Date: Mon, 1 Aug 2016 16:34:43 +0200
> 
> When I put emacs in background (^z) and then in foreground again ("fg",
> bash) sometime emacs will not reset properly the terminal and I won't be
> able to scroll up (using PageUp/PageDown).
> 
> After debugging the issue with a tmux developer, we tracked it down to
> emacs and believe this is an emacs issue with terminal handling when
> going back from background mode.
> 
> I am attaching a snippet of the technical detail about this issue :
> 
> >  When you ^Z, tmux gets 112 bytes in all cases:
> >
> >  input_parse: %0 ground, 40 bytes:
> \n\n\033[K\033[?1l\033>\033[34h\033[?25h\033[?1049l\033[39;49m\r
> >  input_parse: %0 ground, 72 bytes: \r\n[1]+  Stopped
> emacs large_text_file.txt\r\nroot <at> milu:~#
> >
> >  \033[?1049l is rmcup which exits cursor positioning (alternate
> screen) mode.
> >
> >  Then when you type fg, it gets:
> >
> >  input_parse: %0 ground, 694 bytes:
> \033[?1049h\033[34l\033[?1h\033=\033[24;1H\033[K\033[H\033[?25l\033[3mFile
> Edit Options Buffers ...
> >
> >  \033[?1049h is smcup which turns it on again.
> >
> >  But sometimes, it gets:
> >
> >  input_parse: %0 ground, 674 bytes:
> \033[24;1H\033[K\033[H\033[?25l\033[3mFile Edit Options Buffers ...
> >
> >  Where emacs is not sending \033[1049h, or in fact any of the smcup,
> >  cvvis, smkx sequence it normally sends.

Probably because Emacs tries to optimize the cursor motion commands
for minimal cost.  See the code of the cmgoto function (in cm.c in
Emacs sources).

But you didn't tell what terminfo entry is used by Emacs on your
system, and didn't tell what the above terminal commands do on your
terminal, so it's hard to proceed in investigating this issue.

Thanks.




This bug report was last modified 5 years and 129 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.