GNU bug report logs - #2650
Add "lisp/term/screen.el" to support GNU Screen's 256 colors mode

Previous Next

Package: emacs;

Reported by: Prestoo Ten <prestooten <at> gmail.com>

Date: Thu, 12 Mar 2009 19:55:04 UTC

Severity: wishlist

Tags: patch

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 2650 in the body.
You can then email your comments to 2650 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2650; Package emacs. (Thu, 12 Mar 2009 19:55:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Prestoo Ten <prestooten <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 12 Mar 2009 19:55:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Prestoo Ten <prestooten <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Add "lisp/term/screen.el" to support GNU Screen's 256 colors mode
Date: Thu, 12 Mar 2009 21:45:28 +0200
Please consider adding the file "lisp/term/screen.el" with the
following contents to support GNU Screen's "screen-256color" terminal
type:

(load "term/xterm")

(defun terminal-init-screen ()
    "Terminal initialization function for screen."
    ;; Use the xterm color initialization code.
    (xterm-register-default-colors)
    (tty-set-up-initial-frame-faces))

See discussion in the following threads on the emacs-devel mailing list:

http://article.gmane.org/gmane.emacs.devel/87582/
http://article.gmane.org/gmane.emacs.devel/109504/





Severity set to `wishlist' from `normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Fri, 13 Mar 2009 02:40:04 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 25 Jan 2010 22:36:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#2650; Package emacs. (Fri, 30 Jul 2010 21:37:02 GMT) Full text and rfc822 format available.

Message #12 received at 2650 <at> debbugs.gnu.org (full text, mbox):

From: Anders Kaseorg <andersk <at> MIT.EDU>
To: Prestoo Ten <prestooten <at> gmail.com>
Cc: 2650 <at> debbugs.gnu.org
Subject: Re: Add "lisp/term/screen.el" to support GNU Screen's 256 colors mode
Date: Fri, 30 Jul 2010 17:31:52 -0400 (EDT)
On Thu, 12 Mar 2009, Prestoo Ten wrote:
> Please consider adding the file "lisp/term/screen.el" with the
> following contents to support GNU Screen's "screen-256color" terminal
> type:

Note that lisp/faces.el has a heuristic [1] that assumes the terminal has 
a light background for TERM={xterm*,rxvt*,dtterm*,eterm*}, but a dark 
background for other TERMs including TERM=screen*.  So you may also need 
to customize frame-background-mode to 'light to prevent the default colors 
from becoming unreadably bright.  Perhaps the heuristic should be updated?

[1] http://repo.or.cz/w/emacs.git/blob/EMACS_23_2:/lisp/faces.el#l1876




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#2650; Package emacs. (Sun, 27 Feb 2011 20:58:02 GMT) Full text and rfc822 format available.

Message #15 received at 2650 <at> debbugs.gnu.org (full text, mbox):

From: Gregor Zattler <telegraph <at> gmx.net>
To: Anders Kaseorg <andersk <at> MIT.EDU>
Cc: 2650 <at> debbugs.gnu.org, Prestoo Ten <prestooten <at> gmail.com>
Subject: Re: Add "lisp/term/screen.el" to support GNU Screen's 256 colors mode
Date: Sun, 27 Feb 2011 21:41:29 +0100
Hi Anders, Prestoo,

today I discovered this thread and I'm happy to use Prestoo's
solution:

* Anders Kaseorg <andersk <at> MIT.EDU> [30. Jul. 2010]:
> On Thu, 12 Mar 2009, Prestoo Ten wrote:
>> Please consider adding the file "lisp/term/screen.el" with the
>> following contents to support GNU Screen's "screen-256color" terminal
>> type:
> 
> Note that lisp/faces.el has a heuristic [1] that assumes the terminal has 
> a light background for TERM={xterm*,rxvt*,dtterm*,eterm*}, but a dark 
> background for other TERMs including TERM=screen*.  So you may also need 
> to customize frame-background-mode to 'light to prevent the default colors 
> from becoming unreadably bright.  

By chance my background is dark, so no problem for me.

I tested what would happen if my background was white without
other customisations (emacs -Q; screen -c /dev/null) with an
org-mode file.  It is really barely readable. 

That's not the case without screen, because Emacs then recognises
the brightness of the terminal emulators background (at least for
white and black) and adjusts the faces colours.

So, if I used white backround with screen I would have to
customise frame-background-mode via .emacs or utilise .Xdefaults.

But this should not hinder the inclusion of the file
lisp/termscreen.el as provided by the OP.


> Perhaps the heuristic should be updated?
> 
> [1] http://repo.or.cz/w/emacs.git/blob/EMACS_23_2:/lisp/faces.el#l1876

That's still the same in Emacs trunk.  This is way beyond my
elisp literacy.  But Emacs somehow realises is background is dark
or light if invoked in a rxvt-unicode or xterm terminal emulator
window.  This is for some reason not the case when invoked in a
screen session which in turn is invoked in a rxvt-unicode or
xterm.  Perhaps it is somehow possible to detect the background
brightness in screen too?


Thanks, Gregor




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#2650; Package emacs. (Sun, 27 Feb 2011 21:29:01 GMT) Full text and rfc822 format available.

Message #18 received at 2650 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Prestoo Ten <prestooten <at> gmail.com>
Cc: 2650 <at> debbugs.gnu.org, Gregor Zattler <telegraph <at> gmx.net>,
	Anders Kaseorg <andersk <at> MIT.EDU>
Subject: Re: bug#2650: Add "lisp/term/screen.el" to support GNU Screen's 256
	colors mode
Date: Sun, 27 Feb 2011 16:27:54 -0500
I've added term/screen.el to the trunk.




bug marked as fixed in version 24.1, send any further explanations to 2650 <at> debbugs.gnu.org and Prestoo Ten <prestooten <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 27 Mar 2012 19:31:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Apr 2012 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.