The display is wrong when using iTerm2 + screen + emacs on macOS monterey

503 Views Asked by At

When I use iTerm2 + screen + emacs, the display is something wrong. For example, underline is set automatically at whitespace even if I don't customize setting. And character's color is different from what I don't use screen. The color is pink on screen + emacs, but default color must be blue. There is a different behavior between using screen and not using screen. enter image description here

each information I use as below

  • GNU Emacs 28.1
  • Screen version 4.09.00 (GNU) 30-Jan-22

And if I checked list-colors-display in this state, colors are not displayed correctly. enter image description here

If I don't use screen, the display looks good and list-colors-display is shown correctly. enter image description here

And if I use terminal.app instead of iTerm2, it also looks good. enter image description here enter image description here

Please tell me how to display correct on iTerm2.

3

There are 3 best solutions below

0
htano On BEST ANSWER

I found the workaround. If I used emacs 27.1, I don't face this issue.

0
Mohit Aron On

iTerm2 sets COLORTERM environment variable to truecolor that makes emacs think it can use more colors than 256 - which screen doesn't support. Just unset COLORTERM and things should work as expected.

0
GO.exe On

adding below line:

setenv COLORTERM ""

to my ~/.screenrc solved the issue for me.