NomadNet icon indicating copy to clipboard operation
NomadNet copied to clipboard

[BUG] Terminal Colors Modified Upon Exit

Open tonydero opened this issue 2 years ago • 4 comments

I've never seen this before but here is what my terminal colors look like normally: 20220709-14:32:07-screenshot And this is what they look like after exiting nomadnet via Ctrl-q: 20220709-14:32:17-screenshot I know I can just exit and create a new terminal, but I assume that's not desired behavior, so I thought I'd report it.

tonydero avatar Jul 09 '22 20:07 tonydero

Interesting, thanks for reporting this. Did you set nomadnet to 24-bit color mode in the config, or is this with the default 256-color mode? Does the colors return to normal if you run the reset command?

markqvist avatar Jul 09 '22 21:07 markqvist

Also, would you mind sharing what terminal emulator and shell you are using?

markqvist avatar Jul 09 '22 21:07 markqvist

Default config running in zsh 5.9 on wezterm 20210929-205847-2820b2c3. Command reset does work to reset the colors as well.

tonydero avatar Jul 09 '22 21:07 tonydero

Thanks! I should bebable to figure out what is going on from that.

markqvist avatar Jul 09 '22 22:07 markqvist

I am sorry, but I am completely unable to reproduce this using WezTerm-20220905-102802. I will close the issue now, but feel free to reopen if you are still having the issue or can provide any more clues on how to reproduce it.

markqvist avatar Sep 13 '22 21:09 markqvist

After further investigation, I was able to reproduce it in other terminals.

markqvist avatar Sep 28 '22 13:09 markqvist

This issue is now fixed. For future reference, Nomad Network handles terminal colors as follows:

  • If nomadnet is configured for 16 or 88 colors, or the monochrome colo mode, it will set its own terminal color palette based on the colors defined in the user-configured theme. This is done to avoid situations where custom terminal colorschemes makes text unreadable. When exiting nomadnet, the program will restore the users normal color palette by writing an escape sequence that should be supported in most terminals.
  • If nomadnet is configured for one of the high-color modes (256 colors or 24-bit color), it will not touch the terminal palette, but instead directly output color escape sequences for all characters, directly controlling the colors. As such no reset is needed upon exit.

markqvist avatar Sep 28 '22 14:09 markqvist