[Bug 1188862] New: hardcoded COLORTERM=1
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 Bug ID: 1188862 Summary: hardcoded COLORTERM=1 Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: werner@suse.com Reporter: lnussel@suse.com QA Contact: qa-bugs@suse.de CC: meissner@suse.com Found By: --- Blocker: --- playing with notcurses () I noticed that we hardcode COLORTERM=1 in /etc/profile. According to https://github.com/dankamongmen/notcurses/blob/master/TERMINALS.md#the-color... it should be set to "24bit" if the terminal supports it, alternatively the terminfo should have rgb capability. Just did a quick test with the terminal applications we have in kde and xfce and they seem to override the setting and actually set COLORTERM=truecolor. Teaching ssh to relay that setting it would always be reset to 1 via /etc/profile. You can see the effect by installing notcurses-demos and running "notcurses-demo i" with different COLORTERM settings. Maybe time to get rid of COLORTERM handling in /etc/profile at all? mc seems to be colorized in any case :-) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c1 --- Comment #1 from Ludwig Nussel <lnussel@suse.com> --- notcurses upstream link for info https://github.com/dankamongmen/notcurses -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c2 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amajer@suse.com Flags| |needinfo?(amajer@suse.com) --- Comment #2 from Dr. Werner Fink <werner@suse.com> --- This is what was written in /etc/profile long long time ago (1994?) # # Midnight Commander needs this to run in color mode # COLORTERM=1 export COLORTERM I do not use mc (in fact I always deinstall mc as it ingerferes with mv due to possible typo) and I've never added, nor changed, nor removed this setting. Therefore before I change this setting I'd like to know how mc does handle this -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c3 --- Comment #3 from Dr. Werner Fink <werner@suse.com> --- To do this correctly this should be done xrdb -cpp 'cpp -ansi -traditional-cpp' -symbols | grep -i color -DCLASS="TrueColor" -DCLASS_TrueColor=172 -DCOLOR -DCLASS_TrueColor_24=172 -DCLASS_DirectColor_24=173 -DCLASS_TrueColor_32=174 to check supported Colo(u)r Class ... and only for the local used DISPLAY :) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c4 --- Comment #4 from Dr. Werner Fink <werner@suse.com> --- Installed mc to check for COLORTERM and found this strings /usr/bin/mc | grep COLOR COLORTERM Set COLORTERM=truecolor if your terminal really supports true colors. MC_COLOR_TABLE ... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c5 --- Comment #5 from Dr. Werner Fink <werner@suse.com> --- From mc(1) manual page If the program is compiled with the Slang screen manager instead of ncurses, it will also check the variable COLORTERM, if it is set, it has the same effect as the -c flag. Don't know why but our mc is using slang instead of ncurses ldd /usr/bin/mc | grep slang libslang.so.2 => /usr/lib64/libslang.so.2 (0x00007f086fe73000) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c6 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |IN_PROGRESS --- Comment #6 from Dr. Werner Fink <werner@suse.com> --- I've submit the commit 983fd43c3d4cd687bca1802577a98930e1b23d88 to aaa_base which a) removes the COLORTERM=1 from profile as well as csh.login and b) adds the files files/usr/etc/profile.d/term.sh and files/usr/etc/profile.d/term.csh to check via `tput colors` if COLORTERM=truecolor should be set -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c7 Adam Majer <amajer@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(amajer@suse.com) | --- Comment #7 from Adam Majer <amajer@suse.com> --- 1. mc prefers Slang over ncurses, though there is an option to use ncurses too 2. The COLORTERM is to *force* color mode. It works just fine to detect color without this hack. I think it should be removed. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c8 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |FIXED --- Comment #8 from Dr. Werner Fink <werner@suse.com> --- (In reply to Adam Majer from comment #7)
1. mc prefers Slang over ncurses, though there is an option to use ncurses too
2. The COLORTERM is to *force* color mode. It works just fine to detect color without this hack. I think it should be removed.
OK ... I guess that using some of the skins require more than having 8 colors. Therefore the new approach with e.g. cat files/usr/etc/profile.d/term.sh # # Midnight Commander needs this to run in color mode # if test "$(tput colors 2>/dev/null || echo 0)" -gt 8; then COLORTERM=truecolor export COLORTERM fi and similar for tcsh should do the job. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c9 --- Comment #9 from Adam Majer <amajer@suse.com> --- Maybe a better approach is just to remove this hack from the profiles altogether. If this results in some issues for mc, it should probably then be fixed in mc and not system profile. We end up with these legacy hacks that then becomes zombified and passed on the the next generation. With this one, it's almost literal! :-) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c10 --- Comment #10 from Ludwig Nussel <lnussel@suse.com> --- the notcurses docu mentiones some rgb property in terminfo. Maybe we should make sure that one is set correctly instead of touching COLORTERM at all? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c11 --- Comment #11 from Dr. Werner Fink <werner@suse.com> --- (In reply to Ludwig Nussel from comment #10)
the notcurses docu mentiones some rgb property in terminfo. Maybe we should make sure that one is set correctly instead of touching COLORTERM at all?
Using `tput colors` and checking for more then 8 colors should be save AFAIU -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 http://bugzilla.opensuse.org/show_bug.cgi?id=1188862#c12 --- Comment #12 from OBSbugzilla Bot <bwiedemann+obsbugzillabot@suse.com> --- This is an autogenerated message for OBS integration: This bug (1188862) was mentioned in https://build.opensuse.org/request/show/913175 Factory / aaa_base -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1188862 Martin Jambor <mjambor@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugzilla.opensuse.or | |g/show_bug.cgi?id=1190833 -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com