* bug#34606: Emacs colors are off in screen sessions
@ 2019-02-21 14:56 Clément Pit-Claudel
2019-02-21 15:20 ` Eli Zaretskii
2019-07-03 2:31 ` Stefan Kangas
0 siblings, 2 replies; 7+ messages in thread
From: Clément Pit-Claudel @ 2019-02-21 14:56 UTC (permalink / raw)
To: 34606
Hi all,
I'm having issues with color selection and syntax highlighting in Emacs running in screen.
I'm comparing the appearance of `emacs -nw -Q` on GNU / Linux Mint 18.3 (based on Ubuntu 16.04).
In a newly created gnome-terminal window (TERM=xterm-256color), I get orange comments in *scratch*.
In a newly created screen (TERM=screen), I get pale yellow comments in *scratch*. If I change TERM to either xterm-256color or screen-256color, I get the expected orange text.
If I install the ncurses-term package, I get the same colors in gnome-terminal, but in a newly created screen TERM becomes screen.xterm-256color and I get red comments in *scratch*. If I change TERM to xterm-256color nothing changes, and if I change TERM to screen-256color I get the expected orange text (may be relevant: https://emacs.stackexchange.com/questions/20545/emacs-colors-being-set-differently-when-term-is-screen-256color-and-xterm-256)
Is this all as expected? Why does changing to xterm-256color yield different results with or without ncurses-term? If I understand correctly, the reason why TERM changes after I install ncurses-term is that this package provides the screen.xterm-256color termcap entry, and then screen acts as documented:
When screen tries to figure out a terminal name for itself, it first looks for an entry named "screen.<term>",
where <term> is the contents of your $TERM variable. If no such entry exists, screen tries "screen" (…)
Is there anything that Emacs could do differently to make things smoother? In particular, could TERM=screen.xterm-256color behave the same as TERM=screen-256color?
Thanks,
Clément.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#34606: Emacs colors are off in screen sessions
2019-02-21 14:56 bug#34606: Emacs colors are off in screen sessions Clément Pit-Claudel
@ 2019-02-21 15:20 ` Eli Zaretskii
2019-02-21 16:37 ` Clément Pit-Claudel
2019-07-03 2:31 ` Stefan Kangas
1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2019-02-21 15:20 UTC (permalink / raw)
To: Clément Pit-Claudel; +Cc: 34606
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Thu, 21 Feb 2019 09:56:18 -0500
>
> Is this all as expected? Why does changing to xterm-256color yield different results with or without ncurses-term? If I understand correctly, the reason why TERM changes after I install ncurses-term is that this package provides the screen.xterm-256color termcap entry, and then screen acts as documented:
>
> When screen tries to figure out a terminal name for itself, it first looks for an entry named "screen.<term>",
> where <term> is the contents of your $TERM variable. If no such entry exists, screen tries "screen" (…)
>
> Is there anything that Emacs could do differently to make things smoother? In particular, could TERM=screen.xterm-256color behave the same as TERM=screen-256color?
Emacs on a TTY doesn't control the colors in RGB terms, it just tells
the terminal to display color number N. What you actually see as
result is up to the terminfo entry and the terminal emulator, AFAIK
mostly the latter. So I'd suggest to dig into 'screen's
customizations to see how to affect the colors (I customized the
colors of PuTTY to get something I like, for example).
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#34606: Emacs colors are off in screen sessions
2019-02-21 15:20 ` Eli Zaretskii
@ 2019-02-21 16:37 ` Clément Pit-Claudel
2019-02-21 19:21 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Clément Pit-Claudel @ 2019-02-21 16:37 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 34606
On 21/02/2019 10.20, Eli Zaretskii wrote:
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Thu, 21 Feb 2019 09:56:18 -0500
>>
>> Is this all as expected? Why does changing to xterm-256color yield different results with or without ncurses-term? If I understand correctly, the reason why TERM changes after I install ncurses-term is that this package provides the screen.xterm-256color termcap entry, and then screen acts as documented:
>>
>> When screen tries to figure out a terminal name for itself, it first looks for an entry named "screen.<term>",
>> where <term> is the contents of your $TERM variable. If no such entry exists, screen tries "screen" (…)
>>
>> Is there anything that Emacs could do differently to make things smoother? In particular, could TERM=screen.xterm-256color behave the same as TERM=screen-256color?
>
> Emacs on a TTY doesn't control the colors in RGB terms, it just tells
> the terminal to display color number N. What you actually see as
> result is up to the terminfo entry and the terminal emulator, AFAIK
> mostly the latter. So I'd suggest to dig into 'screen's
> customizations to see how to affect the colors (I customized the
> colors of PuTTY to get something I like, for example).
I don't understand. If that is the case, how can changing the value of the TERM environment variable change the colors displayed by emacs?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#34606: Emacs colors are off in screen sessions
2019-02-21 16:37 ` Clément Pit-Claudel
@ 2019-02-21 19:21 ` Eli Zaretskii
2019-02-21 22:06 ` Clément Pit-Claudel
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2019-02-21 19:21 UTC (permalink / raw)
To: Clément Pit-Claudel; +Cc: 34606
> Cc: 34606@debbugs.gnu.org
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Thu, 21 Feb 2019 11:37:25 -0500
>
> > Emacs on a TTY doesn't control the colors in RGB terms, it just tells
> > the terminal to display color number N. What you actually see as
> > result is up to the terminfo entry and the terminal emulator, AFAIK
> > mostly the latter. So I'd suggest to dig into 'screen's
> > customizations to see how to affect the colors (I customized the
> > colors of PuTTY to get something I like, for example).
>
> I don't understand. If that is the case, how can changing the value of the TERM environment variable change the colors displayed by emacs?
Because the terminfo entry defines both the number of colors and the
specific command to turn on a given color. (If that doesn't explain
what you were asking about, maybe I didn't understand the question
well enough.)
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#34606: Emacs colors are off in screen sessions
2019-02-21 19:21 ` Eli Zaretskii
@ 2019-02-21 22:06 ` Clément Pit-Claudel
2019-02-22 7:14 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Clément Pit-Claudel @ 2019-02-21 22:06 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 34606
On 21/02/2019 14.21, Eli Zaretskii wrote:
>> Cc: 34606@debbugs.gnu.org
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Thu, 21 Feb 2019 11:37:25 -0500
>>
>>> Emacs on a TTY doesn't control the colors in RGB terms, it just tells
>>> the terminal to display color number N. What you actually see as
>>> result is up to the terminfo entry and the terminal emulator, AFAIK
>>> mostly the latter. So I'd suggest to dig into 'screen's
>>> customizations to see how to affect the colors (I customized the
>>> colors of PuTTY to get something I like, for example).
>>
>> I don't understand. If that is the case, how can changing the value of the TERM environment variable change the colors displayed by emacs?
>
> Because the terminfo entry defines both the number of colors and the
> specific command to turn on a given color.
Thanks, I understand a bit better. Does that mean that there's a bug in the terminfo database for screen.xterm-256color that causes Emacs' request for a shade of yellow/orange to be displayed as bright red?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#34606: Emacs colors are off in screen sessions
2019-02-21 22:06 ` Clément Pit-Claudel
@ 2019-02-22 7:14 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2019-02-22 7:14 UTC (permalink / raw)
To: Clément Pit-Claudel; +Cc: 34606
> Cc: 34606@debbugs.gnu.org
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Thu, 21 Feb 2019 17:06:35 -0500
>
> Thanks, I understand a bit better. Does that mean that there's a bug in the terminfo database for screen.xterm-256color that causes Emacs' request for a shade of yellow/orange to be displayed as bright red?
No, I think the more probable cause is how the colors are configured
in each terminal emulator, in this case 'screen'.
The translation of a given TTY color to X RGB values are entirely
controlled by how the terminal emulator is configured, hopefully this
is customizable in some way and not hard-coded in the emulator's code.
I suggest to dig into the docs of each emulator and perhaps search the
net for pertinent keywords. Or maybe asking on some relevant forum.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#34606: Emacs colors are off in screen sessions
2019-02-21 14:56 bug#34606: Emacs colors are off in screen sessions Clément Pit-Claudel
2019-02-21 15:20 ` Eli Zaretskii
@ 2019-07-03 2:31 ` Stefan Kangas
1 sibling, 0 replies; 7+ messages in thread
From: Stefan Kangas @ 2019-07-03 2:31 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 34606, Clément Pit-Claudel
tags 34606 + notabug
close 34606
quit
Eli Zaretskii <eliz@gnu.org> writes:
>> Cc: 34606@debbugs.gnu.org
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Thu, 21 Feb 2019 17:06:35 -0500
>>
>> Thanks, I understand a bit better. Does that mean that there's a bug in the terminfo database for screen.xterm-256color that causes Emacs' request for a shade of yellow/orange to be displayed as bright red?
>
> No, I think the more probable cause is how the colors are configured
> in each terminal emulator, in this case 'screen'.
>
> The translation of a given TTY color to X RGB values are entirely
> controlled by how the terminal emulator is configured, hopefully this
> is customizable in some way and not hard-coded in the emulator's code.
> I suggest to dig into the docs of each emulator and perhaps search the
> net for pertinent keywords. Or maybe asking on some relevant forum.
It doesn't look like there is much more to do here, so I'm closing this
as notabug. If anyone disagrees, feel free to reopen.
Thanks,
Stefan Kangas
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-07-03 2:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-21 14:56 bug#34606: Emacs colors are off in screen sessions Clément Pit-Claudel
2019-02-21 15:20 ` Eli Zaretskii
2019-02-21 16:37 ` Clément Pit-Claudel
2019-02-21 19:21 ` Eli Zaretskii
2019-02-21 22:06 ` Clément Pit-Claudel
2019-02-22 7:14 ` Eli Zaretskii
2019-07-03 2:31 ` Stefan Kangas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).