all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: Eli Zaretskii <eliz@gnu.org>, Chong Yidong <cyd@gnu.org>
Cc: 10959@debbugs.gnu.org
Subject: bug#10959: 23.3; emacs -nw doesn't always restore the terminal screen
Date: Sat, 16 Jun 2012 18:13:26 +0200	[thread overview]
Message-ID: <20120616161326.GF4955@xvii.vinc17.org> (raw)
In-Reply-To: <87y5nn37b4.fsf@gnu.org> <831ulfg0ux.fsf@gnu.org>

On 2012-06-16 10:41:26 +0300, Eli Zaretskii wrote:
> I know very little about this, but here's what I know: this feature
> relies upon the "ti" and "te" terminal capabilities.  We use these
> capabilities in tty_set_terminal_modes and tty_reset_terminal_modes,
> respectively.  In both cases, we output the terminal command only if
> the tty->output FILE stream is non-NULL.  So perhaps some timing
> issues cause tty->output to become NULL before we get to
> tty_reset_terminal_modes, or maybe it is still NULL when we get to
> tty_set_terminal_modes?

Since the bug is not always reproducible, it is likely to be a timing
problem.

> In any case, adding some logs to those places could show if that is
> the problem.

Yes, this would be a good idea.

> Alternatively, could it be a problem with the terminal emulators, not
> in Emacs?

As this problem occurs with 3 different terminal emulators (including
at least 2 very different ones: xterm and gnome-terminal), I doubt
about this.

On 2012-06-16 18:00:31 +0800, Chong Yidong wrote:
> I committed a patch to xterm.el that seems to stop the bug from
> happening with the posted recipe.  It adds a `discard-input' call before
> doing the xterm Report Background query, as is already done for the
> Device Attributes query earlier in `terminal-init-xterm'.  I am still
> not 100% sure of the chain of effect leading to the bug, though.

I wonder whether this makes the timing problem much less likely
or this is a real fix (there isn't any input from the user). Is
xterm.el also used for gnome-terminal?

Is this related to the following bug?

  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11129

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)





  parent reply	other threads:[~2012-06-16 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 15:01 bug#10959: 23.3; emacs -nw doesn't always restore the terminal screen Vincent Lefevre
2012-03-22 11:19 ` Vincent Lefevre
2012-06-15 14:21   ` Vincent Lefevre
2012-06-16  6:26     ` Stefan Monnier
2012-06-16  7:41       ` Eli Zaretskii
2012-06-16 10:00         ` Chong Yidong
2012-06-16 16:13         ` Vincent Lefevre [this message]
2012-03-22 11:25 ` Vincent Lefevre
2012-03-22 15:38 ` Stefan Monnier
2015-10-09 12:59 ` Vincent Lefevre

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=20120616161326.GF4955@xvii.vinc17.org \
    --to=vincent@vinc17.net \
    --cc=10959@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=eliz@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.