all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Jorgen Schaefer <contact@jorgenschaefer.de>
Cc: 20356@debbugs.gnu.org
Subject: bug#20356: 25.0.50; Strange terminal glyphs in emacs -nw in recent master
Date: Thu, 30 Apr 2015 18:31:00 -0400	[thread overview]
Message-ID: <jwvbni59rmr.fsf-monnier+bug#20356@gnu.org> (raw)
In-Reply-To: <87twwfnloz.fsf@loki.jorgenschaefer.de> (Jorgen Schaefer's message of "Fri, 17 Apr 2015 11:33:32 +0200")

> 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...)





  parent reply	other threads:[~2015-04-30 22:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17  9:33 bug#20356: 25.0.50; Strange terminal glyphs in emacs -nw in recent master Jorgen Schaefer
2015-04-17 12:26 ` Eli Zaretskii
2015-04-17 15:32   ` Jorgen Schäfer
2015-04-17 16:20     ` Eli Zaretskii
2015-04-19  8:24     ` Ivan Shmakov
2015-04-20  2:08       ` Stefan Monnier
2015-04-17 14:39 ` Stefan Monnier
2015-04-24 12:26   ` Jorgen Schäfer
2015-04-24 14:07     ` Stefan Monnier
2015-04-24 14:16       ` Jorgen Schäfer
2015-04-24 15:42         ` Thierry Volpiatto
2015-04-24 18:11         ` Stefan Monnier
2015-04-30 22:31 ` Stefan Monnier [this message]
2015-05-01 13:44   ` Jorgen Schäfer
2015-05-04  1:21     ` Stefan Monnier

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='jwvbni59rmr.fsf-monnier+bug#20356@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=20356@debbugs.gnu.org \
    --cc=contact@jorgenschaefer.de \
    /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.