Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No bright colors under screen/irssi in SSH session #7506

Closed
sec opened this issue Sep 2, 2020 · 6 comments
Closed

No bright colors under screen/irssi in SSH session #7506

sec opened this issue Sep 2, 2020 · 6 comments
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons. Resolution-External For issues that are outside this codebase

Comments

@sec
Copy link

sec commented Sep 2, 2020

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.450]
Windows Terminal version 1.2.2381.0 and Preview 1.3.2382.0

Steps to reproduce

  1. SSH to remote machine (FreeBSD used here)
  2. run 'screen irssi'
  3. under irssi: /exec colors.sh

colors.sh

Expected behavior

Bright colors (bottom part of the image)

Actual behavior

Only "normal" colors are visible (top part of the image), like the bright/bold are replaced by normal ones:
image

Bottom part is when irssi is launched without "screen".
Colors are working fine when using Windows Terminal v1.1.2233.0

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 2, 2020
@DHowett
Copy link
Member

DHowett commented Sep 2, 2020

screen is another terminal emulator, and as such it has the chance to manipulate all colors that come through it.

Can you share the output of echo $TERM; infocmp inside and outside screen?

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 2, 2020
@sec
Copy link
Author

sec commented Sep 2, 2020

screen is another terminal emulator, and as such it has the chance to manipulate all colors that come through it.

Can you share the output of echo $TERM; infocmp inside and outside screen?

Yes I know that, but weird it started to behave that way after upgrade to 1.2.
TERM inside screen is screen
TERM outside screen is xterm-256color

I don't have infocmp as I'm on 11.4 (can provide more info when I'll upgrade the box to 12).

I tried setting TERM to xterm-256color and even screen-256color inside screen, then launching irssi - still no bold colors.
Weird this is, that under screen, colors are ok, it's just that launching irssi is causing this weird behavior.

Just found that if I set TERM to xterm and then screen -r - colors are fine. Looks like xterm-256color is broken, at least for me :)
Any way I can set TERM to something else under Windows Terminal ?

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 2, 2020
@DHowett
Copy link
Member

DHowett commented Sep 2, 2020

I believe I've seen this before, actually. When screen believes that the outer terminal is true-color-compatible, but cannot handle certain other sequences, it will translate the colors on the inside. In 1.2 we actually improved color rendition... which tends to expose applications doing unexpected things.

Can you run script, and then reproduce the screen+irssi color issue? It should produce a document named typescript that contains the raw output from screen that we're receiving in the Terminal. I'd be interested in seeing that document.

@DHowett DHowett added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Sep 2, 2020
@sec
Copy link
Author

sec commented Sep 2, 2020

Issue with colors
No issue with colors, launched irssi outside screen

Happy reading :) let me know if I can help more

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 2, 2020
@DHowett
Copy link
Member

DHowett commented Sep 2, 2020

Thanks! So, bad news. (Those two pastes are the same thing, but:)

The inbox termcap for screen-256color suggests that all colors must be rendered using ITU extended sequences. This means that irssi is translating \e[91m to \e[38;5;1m\e[1m. We (and many other terminal emulators) decided that brighten/intensity should not apply to the extended ITU colors (#5384)... so this translation is "incorrect" from the perspective of modern terminal emulation.

The updated terminfo seems to specify that colors should be treated with more care (cf this entry for xterm+256setaf, which is the base type for screen-256color), but perhaps that hasn't reached your ports tree yet.

The resolution to this one is, for now, "by design". Sorry!

@DHowett DHowett closed this as completed Sep 2, 2020
@DHowett DHowett added Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons. Resolution-External For issues that are outside this codebase and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 2, 2020
@jdebp
Copy link

jdebp commented Sep 2, 2020

These seem to be the parts of irssi to look at. Notice that they are triggered when irssi thinks that it is talking to an 8-color terminal, which of course the termcap database says that the screen terminal type is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons. Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

3 participants