You are not logged in.

#1 2018-09-03 14:44:10

tpreston
Member
Registered: 2018-09-03
Posts: 4

Suckess st has reversed solarized colours with tmux, vim and ncurses

Hi,
I'm using st from https://st.suckless.org/ with the solarized-light colour patches applied like so: https://github.com/tompreston/st/commit … -solarized

Everything works fine except for the colours in tmux and vim. I have to use the "dark" themes instead of the light ones. Also, ncurses applications (such as `make menuconfig`) look weird.
- https://imgur.com/n8B8Rtu
- https://imgur.com/LPZuR0M (top is st built from above, bottom is terminator with solarized light turned on)

I've also built st using the sources/patches from the AUR but I get the same results.
- https://aur.archlinux.org/packages/st-solarized/

This only happens in st, everything works fine in terminator or xterm (with the solarized colour theme). Have I applied the changes incorrectly? My `TERM=screen-256colours`

Thanks

Last edited by tpreston (2018-09-03 14:44:24)

Offline

#2 2018-09-03 16:55:13

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Suckess st has reversed solarized colours with tmux, vim and ncurses

tpreston wrote:

My `TERM=screen-256colours`

Why/where are you setting that?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2018-09-03 16:57:31

tpreston
Member
Registered: 2018-09-03
Posts: 4

Re: Suckess st has reversed solarized colours with tmux, vim and ncurses

.bashrc and before running st like so:

TERM=screen-256colors st

Without it, tmux messes up ncurses applications: https://unix.stackexchange.com/a/139076

Offline

#4 2018-09-03 17:24:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Suckess st has reversed solarized colours with tmux, vim and ncurses

Remove that from your bashrc, that's just completely wrong.  Never set TERM directly/manually.

You *can* tell tmux to set term appropriately in your tmux.conf:

set -g default-terminal screen-256color

But outside of tmux, it should be set by st, in my case thats `st-256color`.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2018-09-04 09:17:43

tpreston
Member
Registered: 2018-09-03
Posts: 4

Re: Suckess st has reversed solarized colours with tmux, vim and ncurses

Okay I have removed TERM from my .bashrc and it is set correctly in st to "st-256color". In tmux, it is set to "screen-256color" because I already had that line in my .tmux.conf:

set -g default-terminal screen-256color

This has not fixed the reversed colours or ncurses issue. What is unusual is that the "dark" settings also work when I change st colours to solarized-dark. So this is a problem with st solarized-light. ncurses applications still look weird. I wonder how a terminal like terminator handles this.

Trilby: Do you use an st colour scheme? How does tmux or ncurses applications behave for you?

Last edited by tpreston (2018-09-04 09:23:30)

Offline

#6 2018-09-04 12:47:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Suckess st has reversed solarized colours with tmux, vim and ncurses

I defined colors in st's config.h.  I have no issues with colors in tmux, vim, etc.  But I don't use someone elses "colorsheme".  I just looked at the config.def.h provided in the link in your first post.  If you look at the code you are using before just copy/pasting it, you should have spotted the problem.  The author defined "black" as a light color and "white" as a dark color.  Of course that will give you problems.  That is not how solarized colors are supposed to work.  Just define your colors per solarized's hex codes then set the default bg and fg to the white and black colors respectively.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2018-09-04 22:59:34

tpreston
Member
Registered: 2018-09-03
Posts: 4

Re: Suckess st has reversed solarized colours with tmux, vim and ncurses

Ah-ha indeed the colours are incorrect, I have corrected them in the following branch:
- https://github.com/tompreston/st/commit … olarized-2

I will send patches to both suckless.org and the AUR when I get a chance.

For what it's worth, the ncurses colours are still strange and I'd rather these stayed the same as the original (as with other terminal emulators).

Thanks for your help Trilby.

Offline

#8 2018-09-04 23:09:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Suckess st has reversed solarized colours with tmux, vim and ncurses

Ha, oops - I didn't realize that was *your* repo, sorry about that part.  I suspected you copied someone else's config.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB