From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vincent Lefevre Newsgroups: gmane.emacs.bugs Subject: bug#10959: 23.3; emacs -nw doesn't always restore the terminal screen Date: Sat, 16 Jun 2012 18:13:26 +0200 Message-ID: <20120616161326.GF4955@xvii.vinc17.org> References: <20120306150104.GC3281@xvii.vinc17.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1339863245 24623 80.91.229.3 (16 Jun 2012 16:14:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 16 Jun 2012 16:14:05 +0000 (UTC) Cc: 10959@debbugs.gnu.org To: Eli Zaretskii , Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 16 18:14:03 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SfvdT-0006PM-IP for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jun 2012 18:14:03 +0200 Original-Received: from localhost ([::1]:53173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfvdT-0003cl-Ca for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jun 2012 12:14:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfvdP-0003cF-SL for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 12:14:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfvdN-0006NO-VI for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 12:13:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfvdN-0006Ma-RF for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 12:13:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SfvgM-0008Kh-Lb for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 12:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincent Lefevre Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2012 16:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10959 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10959-submit@debbugs.gnu.org id=B10959.133986339831977 (code B ref 10959); Sat, 16 Jun 2012 16:17:02 +0000 Original-Received: (at 10959) by debbugs.gnu.org; 16 Jun 2012 16:16:38 +0000 Original-Received: from localhost ([127.0.0.1]:45037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sfvfw-0008Jd-JO for submit@debbugs.gnu.org; Sat, 16 Jun 2012 12:16:38 -0400 Original-Received: from vinc17.pck.nerim.net ([213.41.242.187]:55831 helo=smtp-xvii.vinc17.net) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sfvft-0008JS-7L for 10959@debbugs.gnu.org; Sat, 16 Jun 2012 12:16:35 -0400 Original-Received: by xvii.vinc17.org (Postfix, from userid 1000) id AC8E031000C; Sat, 16 Jun 2012 18:13:26 +0200 (CEST) Content-Disposition: inline In-Reply-To: <87y5nn37b4.fsf@gnu.org> <831ulfg0ux.fsf@gnu.org> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6205-vl-r52214 (2012-05-24) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61040 Archived-At: 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 befor= e > 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=3D11129 --=20 Vincent Lef=E8vre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)