lxqt / qtermwidget

The terminal widget for QTerminal
https://lxqt.github.io
GNU General Public License v2.0
497 stars 254 forks source link

Support OSC 4 Change Color Number (was: Vis editor) #340

Open travankor opened 4 years ago

travankor commented 4 years ago

I'm testing qterminal-git with QT5.14.2. The vis editor is broken on the default settings and shows a blue screen. Typing TERM=screen-256color vis fixes this issue.

I think this affects KDE's Konsole, too.

travankor commented 4 years ago

https://github.com/martanne/vis/wiki/FAQ#my-terminal-colors-are-messed-up-what-is-going-on

Some terminals (e.g. Apple's Terminal.app) incorrectly advertise the "can change color" ccc (seeterminfo(5)) capability, even though they are incapable of performing the requested change. As a result terminal colors end mixed up. Since we start replacing just after the initial 16 colors, this usually has the symptom of the editor appearing in dark blues and greens.

travankor commented 4 years ago

I don't think it's correct to set xterm-256color currently, when xterm handles this correctly.

I think either qterminal should set TERM as konsole-256color by default (or ship a custom terminfo) or correctly change color for curses.

yan12125 commented 4 years ago

Thanks for the report. Yep with TERM=xterm-256color, ccc is advertised, but qtermwidget does not respond to Change Color Number (OSC 4) requests. I will try to add support for OSC 4. The long term goal is achieving xterm comaptibility.

yan12125 commented 4 years ago

As a side note, after OSC 4, vis uses CSI 38;5 to use indexed color.