clangen / musikcube

a cross-platform, terminal-based music player, audio engine, metadata indexer, and server in c++
https://musikcube.com
BSD 3-Clause "New" or "Revised" License
4.25k stars 292 forks source link

musikcubed doesn't recognize screen-256color terminal string? #481

Open acook opened 2 years ago

acook commented 2 years ago

When using screen-256color musikcube launches successfully but falls back to a default color scheme (instead of my custom true color scheme) but works fine with TERM=xterm-256color musikcube.

When I pass in, say, TERM=foobar musikcube, it fails to set up a terminal with:

warning: Could not set up terminal.
warning: TERM environment variable set to 'foobar'.
warning: Check that this terminal type is supported on this system.
warning: Using fallback terminal type 'ansi'.
warning: Could not set up terminal.
warning: TERM environment variable set to 'foobar'.
warning: Check that this terminal type is supported on this system.
warning: Using fallback terminal type 'ansi'.
fish: Job 1, 'TERM=foobar musikcube' terminated by signal SIGABRT (Abort)

The above error seems to be similar to the output of tput, but tput outputs 256 for both xterm-256color and screen-256color.

I dug around in the code a little trying to understand where musikcube was getting its info but other than Colors.cpp I wasn't sure.

clangen commented 2 years ago

xterm-256color definitely works for me in both macOS (with iTerm and Terminal.app) and Linux using the various terminal emulators I have installed.

image

Can you tell me a bit more about which operating system and terminal you're using?

clangen commented 2 years ago

Oops, sorry, I misread the original post. Hmm, I'm not sure why it wouldn't support screen-256color -- I'll have to play around a bit with it... but like I mentioned in the previous post, the app relies on ncurses for color mode capabilities detection.

acook commented 2 years ago

Yeah it's weird, it's the only app I've used with this problem. It could be that my other terminal apps are forced to true color, or don't check? I'm not sure. If you can think of something that would give me similar results, or something I can run to extract what ncurses is telling musikcube I'll do that to help figure it out.

I'm on Solus Linux, fully updated. It ships with Gnome Terminal:

Linux monolith 5.14.21-210.current #1 SMP PREEMPT Sun Dec 5 21:23:09 UTC 2021 x86_64 GNU/Linux

Version 3.42.1 for GNOME 41
A terminal emulator for the GNOME desktop
Using VTE version 0.64.2 +BIDI +GNUTLS +ICU +SYSTEMD
r0bis commented 2 years ago

Hey, thanks for the great program!

Just to say that on my home server - where I do not run X there is no possibility to change the colour scheme. I mean the terminal is the real terminal. Is it supposed to be like that or am I missing something?

Thanks R