dvdhrm / kmscon

Linux KMS/DRM based virtual Console Emulator
http://www.freedesktop.org/wiki/Software/kmscon
Other
436 stars 81 forks source link

Export enviromental variable which would indicate that we are in KMSCON #60

Closed swiftgeek closed 11 years ago

swiftgeek commented 11 years ago

One of the widely used ones is $COLORTERM

It's needed for eg. automatically spawning instance of tmux (which i don't want to do in gnome-terminal/Terminal)

Couple of terminals that sets COLORTERM — gnome-terminal, Terminal, rxvt-xpm One that doesn't — terminology

Most of those which are running under X11 are using xterm-256color terminfo/termcap, so there was a need to differentiate them from the shell script in this way ;)

dvdhrm commented 11 years ago

Uh, yeah, we should probably set some environment variable. But to be honest, I am not 100% sure what COLORTERM is used for if TERM is set to something different. Applications might check this and as long as we don't ship a kmscon terminfo/termcap file, I don't think we should set this.

I will think about it, but some more investigation is definitely needed. Thanks!

swiftgeek commented 11 years ago

TERM is for terminfo/termcap and COLORTERM is for real name of the terminal (usually). It's used because almost every terminal emulator is using xterm-256color terminfo. Not all terminal emulators are setting COLORTERM (eg. terminology, but it's quite a fresh terminal emulator)

dvdhrm commented 11 years ago

I had to make /bin/login preserve the environment to actually pass COLORTERM through, but this is now possible. See commit 6be24df169a7af60ed5106b1cd200d2ba7907333 This should fix the issue.