From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#10959: 23.3; emacs -nw doesn't always restore the terminal screen Date: Sat, 16 Jun 2012 10:41:26 +0300 Message-ID: <831ulfg0ux.fsf@gnu.org> References: <20120306150104.GC3281@xvii.vinc17.org> <20120322111920.GA20264@xvii.vinc17.org> <20120615142113.GA24433@xvii.vinc17.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1339832526 22320 80.91.229.3 (16 Jun 2012 07:42:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 16 Jun 2012 07:42:06 +0000 (UTC) Cc: 10959@debbugs.gnu.org, vincent@vinc17.net To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 16 09:42:05 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 1Sfne0-000451-13 for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jun 2012 09:42:04 +0200 Original-Received: from localhost ([::1]:44691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfndz-0000SX-Pt for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jun 2012 03:42:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfndw-0000S1-Uk for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 03:42:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sfndv-0003Nv-Am for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 03:42:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfndv-0003Nr-7L for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 03:41:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sfngr-0004fk-Oq for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 03:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2012 07:45:01 +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.133983267017909 (code B ref 10959); Sat, 16 Jun 2012 07:45:01 +0000 Original-Received: (at 10959) by debbugs.gnu.org; 16 Jun 2012 07:44:30 +0000 Original-Received: from localhost ([127.0.0.1]:44549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SfngM-0004eo-0I for submit@debbugs.gnu.org; Sat, 16 Jun 2012 03:44:30 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:59538) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SfngJ-0004eg-VQ for 10959@debbugs.gnu.org; Sat, 16 Jun 2012 03:44:29 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M5P008009CADC00@a-mtaout20.012.net.il> for 10959@debbugs.gnu.org; Sat, 16 Jun 2012 10:41:23 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M5P0073Z9CZZ660@a-mtaout20.012.net.il>; Sat, 16 Jun 2012 10:41:23 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il 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:61035 Archived-At: > From: Stefan Monnier > Date: Sat, 16 Jun 2012 02:26:41 -0400 > Cc: 10959@debbugs.gnu.org > > >> This problem still occurs with GNU Emacs 23.4.1 from the Debian > >> package emacs23 23.4+1-2 (tested in xterm). > > and it still occurs with the official GNU Emacs 24.1.1. > > Thanks for checking and confirming. I hope someone who actually know > about such terminal setup/restore will have a chance to look at it. 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? In any case, adding some logs to those places could show if that is the problem. Alternatively, could it be a problem with the terminal emulators, not in Emacs?