From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20356: 25.0.50; Strange terminal glyphs in emacs -nw in recent master Date: Thu, 30 Apr 2015 18:31:00 -0400 Message-ID: References: <87twwfnloz.fsf@loki.jorgenschaefer.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430433152 10949 80.91.229.3 (30 Apr 2015 22:32:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Apr 2015 22:32:32 +0000 (UTC) Cc: 20356@debbugs.gnu.org To: Jorgen Schaefer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 01 00:32:13 2015 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 1Ynx08-0004qh-4j for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 May 2015 00:32:12 +0200 Original-Received: from localhost ([::1]:46131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynx07-00045P-6Y for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Apr 2015 18:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynx02-000406-ML for bug-gnu-emacs@gnu.org; Thu, 30 Apr 2015 18:32:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ynwzz-0007ME-0F for bug-gnu-emacs@gnu.org; Thu, 30 Apr 2015 18:32:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynwzy-0007MA-UE for bug-gnu-emacs@gnu.org; Thu, 30 Apr 2015 18:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Ynwzy-0007Ob-Em for bug-gnu-emacs@gnu.org; Thu, 30 Apr 2015 18:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Apr 2015 22:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20356-submit@debbugs.gnu.org id=B20356.143043307228368 (code B ref 20356); Thu, 30 Apr 2015 22:32:02 +0000 Original-Received: (at 20356) by debbugs.gnu.org; 30 Apr 2015 22:31:12 +0000 Original-Received: from localhost ([127.0.0.1]:57856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ynwz7-0007NS-UV for submit@debbugs.gnu.org; Thu, 30 Apr 2015 18:31:11 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:32528) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ynwz4-0007Mv-BQ for 20356@debbugs.gnu.org; Thu, 30 Apr 2015 18:31:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnEFAGvvdVS4rw4V/2dsb2JhbAA3gVOfQYIugQiBdQEBBAFWIwULCw4mEhQYDSSIE6IRjCeECgMDg20Eo2OEWA X-IPAS-Result: AnEFAGvvdVS4rw4V/2dsb2JhbAA3gVOfQYIugQiBdQEBBAFWIwULCw4mEhQYDSSIE6IRjCeECgMDg20Eo2OEWA X-IronPort-AV: E=Sophos;i="5.11,557,1422939600"; d="scan'208";a="117934628" Original-Received: from 184-175-14-21.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([184.175.14.21]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Apr 2015 18:31:00 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 89E01AE0BD; Thu, 30 Apr 2015 18:31:00 -0400 (EDT) In-Reply-To: <87twwfnloz.fsf@loki.jorgenschaefer.de> (Jorgen Schaefer's message of "Fri, 17 Apr 2015 11:33:32 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:102299 Archived-At: > This is in a Gnome Terminal with TERM=xterm, sshing to a server, and > Emacs started in a screen with TERM=screen. Can you confirm that the patch below fixes the problem you're seeing? Stefan diff --git a/lisp/term/screen.el b/lisp/term/screen.el index 3587c4f..41fd916 100644 --- a/lisp/term/screen.el +++ b/lisp/term/screen.el @@ -1,9 +1,22 @@ ;;; screen.el --- terminal initialization for screen and tmux -*- lexical-binding: t -*- ;; Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc. +(require 'term/xterm) + +(defcustom xterm-screen-extra-capabilities '(modifyOtherKeys) + "Extra capabilities supported under \"screen\". +Some features of screen depend on the terminal emulator in which +it runs, which can change when the screen session is moved to another tty." + :type xterm--extra-capabilities-type + :group 'xterm) + (defun terminal-init-screen () "Terminal initialization function for screen." - ;; Treat a screen terminal similar to an xterm. - (tty-run-terminal-initialization (selected-frame) "xterm")) + ;; Treat a screen terminal similar to an xterm, but don't use + ;; xterm-extra-capabilities's `check' setting since that doesn't seem + ;; to work so well (it depends too much on the surrounding terminal + ;; emulator, which can change during the session, bug#20356). + (let ((xterm-extra-capabilities xterm-screen-extra-capabilities)) + (tty-run-terminal-initialization (selected-frame) "xterm"))) ;; screen.el ends here diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 726ecf9..4311647 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -29,6 +29,13 @@ :version "24.1" :group 'terminals) +(defconst xterm--extra-capabilities-type + ;; NOTE: If you add entries here, make sure to update + ;; `terminal-init-xterm' as well. + '(set (const :tag "modifyOtherKeys support" modifyOtherKeys) + (const :tag "report background" reportBackground) + (const :tag "set X selection" setSelection))) + (defcustom xterm-extra-capabilities 'check "Whether Xterm supports some additional, more modern, features. If nil, just assume that it does not. @@ -40,13 +47,8 @@ The relevant features are: reportBackground -- if supported, Xterm reports its background color setSelection -- if supported, Xterm saves yanked text to the X selection" :version "24.1" - :type '(choice (const :tag "No" nil) - (const :tag "Check" check) - ;; NOTE: If you add entries here, make sure to update - ;; `terminal-init-xterm' as well. - (set (const :tag "modifyOtherKeys support" modifyOtherKeys) - (const :tag "report background" reportBackground) - (const :tag "set X selection" setSelection)))) + :type `(choice (const :tag "Check" check) + ,xterm--extra-capabilities-type)) (defcustom xterm-max-cut-length 100000 "Maximum number of bytes to cut into xterm using the OSC 52 sequence. @@ -623,8 +625,8 @@ string bytes that can be copied is 3/4 of this value." (setq version 200)) (when (equal (match-string 1 str) "83") ;; `screen' (which returns 83;40003;0) seems to also lack support for - ;; some of these (bug#17607). - (setq version 240)) + ;; some of these (bug#17607, bug#20356). + (setq version 200)) ;; If version is 242 or higher, assume the xterm supports ;; reporting the background color (TODO: maybe earlier ;; versions do too...)