selectel / pyte

Simple VTXXX-compatible linux terminal emulator
http://pyte.readthedocs.org/
GNU Lesser General Public License v3.0
649 stars 101 forks source link

Color information loss with `nano`? #167

Closed matkuki closed 10 months ago

matkuki commented 1 year ago

Hi

I'm using Pyte to create a terminal emulator and most things work without problems, but when running the nano editor, the color information seems to be lost. This is a screenshot of running nano with Pyte: image ... but it should look like this (this is example of running nano in a default terminal): image

To test that my color handling is working I ran the 256 color test and I get this: image ... so the color handling is correct.

Any ideas on how to fix this?

matkuki commented 1 year ago

@superbobry I've also checked that there is no color information in the buffer, so when printing the bg and fg of each character, it's always default for both for all characters in the buffer, when the nano screen is loaded.

mumu-lhl commented 10 months ago

When reverse of character is True, you need to swap the default color โ€‹โ€‹โ€‹โ€‹of fg and bg.

matkuki commented 10 months ago

@mumu-lhl Yes, that's it, thanks ๐Ÿ‘