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.

Full log


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




This bug report was last modified 13 years and 117 days ago.

Previous Next


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