You are not logged in.

#1 2022-12-29 22:41:12

kfl
Member
Registered: 2013-04-28
Posts: 4

xterm not properly showing colors when in TERM=xterm-256color

Hi I've set TERM to xterm-256color in $HOME/.Xresources and properly reloaded with xrdb. Now in xterm, it properly reports TERM to be xterm-256color. However, I still don't get colors in applications (e.g., vim, mc, ls).

How should I properly debug this? Thanks!

I'm using xinit + fluxbox

Offline

#2 2022-12-29 23:06:57

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: xterm not properly showing colors when in TERM=xterm-256color

Never set TERM explicitly. EDIT: hold on, you can't set TERM via ~/.Xresources, or at least AFAIK hmm

Colours work fine for me in xterm so you should probably post ~/.Xresources and your shell initialisation file(s).

Do the colours work if you use startx and the recommended ~/.xinitrc headers?

Using plain xinit means that the systemd --user environment won't be setup correctly, amongst other things.

Last edited by Head_on_a_Stick (2022-12-29 23:07:53)


Jin, Jîyan, Azadî

Offline

#3 2022-12-29 23:41:05

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

Re: xterm not properly showing colors when in TERM=xterm-256color

Have you configured colors for vim (e.g., `syntax on`), ls (e.g., using an alias with the --color flag), and mc (no idea how)?

At least the first two do not use colors by default even if the terminal supports them.  As a related check, are these commands producing color output on a console outside of X?


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

Offline

#4 2022-12-29 23:54:39

kfl
Member
Registered: 2013-04-28
Posts: 4

Re: xterm not properly showing colors when in TERM=xterm-256color

Trilby wrote:

are these commands producing color output on a console outside of X?

Yes they are. I do have the apps properly configured.

As a comparison, In same x11 environment, alacritty colors work out of box. its TERM is alacritty which is present in terminfo

Also if I start alacritty with `TERM=xterm-256color alacritty`, it also displays colors properly.

Last edited by kfl (2022-12-30 00:04:00)

Offline

#5 2022-12-30 01:04:39

kfl
Member
Registered: 2013-04-28
Posts: 4

Re: xterm not properly showing colors when in TERM=xterm-256color

It turns out that it's because I have #include in my Xresources file to define the colors, and my arch installation doesn't have the C preprocessor installed to process the macros. Once I installed core/gcc, and them xrdb load it, the problem goes away.

Offline

#6 2022-12-30 08:07:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,151

Re: xterm not properly showing colors when in TERM=xterm-256color

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB