martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.21k stars 258 forks source link

All themes are broken in Konsole (KDE Terminal) #930

Closed yerlaser closed 3 years ago

yerlaser commented 3 years ago

My TERM is set to xterm-256color and when I run vis I get unreadable colors. Tried changing themes and the only one that produces readable output is light-16, but of course I don't want to stay in 16 colors all the time.

I also tried to set TERM to screen-256color, that produces slightly better output, but the theme colors are still wrong. Solarized for example is dark brown.

martanne commented 3 years ago

What version of Konsole are you using? Is it normal that you use xterm as $TERM value?

I vaguely recall some reports, that Konsole doesn't support changing the color palette, indicated by the ccc terminfo capability. However, because you are disguising your terminal as a xterm (which supports and advertises the capability) things fall apart.

$ infocmp xterm-256color | grep ccc 
    am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
$ infocmp konsole-256color | grep ccc

You could try setting the vis option set change-256colors off from the INIT event. But that has to happen before the theme is loaded.

martanne commented 3 years ago

I just checked the screen-256color terminfo entry and it doesn't advertise the color change mechanism. So it seems that is what you would get in konsole.

I suggest to chose/write a theme which only uses standard colors.

yerlaser commented 3 years ago

Hi, Thanks for the answer. My Konsole version is: 20.12.2 (It's from Kubuntu Hirsute, so I hope it's latest and greatest) I checked your command and indeed: infocmp xterm-256color | grep ccc am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, While this return nothing. infocmp screen-256color | grep ccc

I started to Google this in relation to Konsole and found this: https://bugs.kde.org/show_bug.cgi?id=344181 Seems to be related. Sadly, it seems VIS is unusable then in Konsole. Perhaps it's worth noting it somewhere in Errata

yerlaser commented 3 years ago

By the way, I also tried your suggestion to set change-256colors off That does change colors a bit, but they are still not correct. Anyway, after some trial and error I was able to setup a dark Konsole theme and create an alias (alias vis='TERM=screen-256color vis') which produce something that I can work with for now. Closing this, at it seems not a VIS issue.