gnome-terminal doesn't set $COLORTERM from 3.14 onwards

Bug #1429584 reported by DipSwitch
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Opinion
Undecided
Unassigned

Bug Description

Gnome terminal has dropped the $COLORTERM workaround for invalid terminfo/termcap.

References:
https://github.com/GNOME/gnome-terminal/commit/1d5c1b6ca6373c1301494edbc9e43c3e6a9c9aaf
https://bugzilla.redhat.com/show_bug.cgi?id=1165439
https://bugzilla.redhat.com/show_bug.cgi?id=1173688
https://bugzilla.redhat.com/show_bug.cgi?id=1166428

This affects release: Vivid Vervet

Workaround I currently use is `.bashrc`:
 if [ -z "$COLORTERM" ] && cat /proc/$PPID/exe 2> /dev/null | grep -q gnome-terminal; then
  export COLORTERM=gnome-terminal
 fi

DipSwitch (nick-ds)
description: updated
description: updated
DipSwitch (nick-ds)
description: updated
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> This affects release: Vivid Vervet

How exactly does it effect it?

$COLORTERM was dropped for a good reason; appart from the links you posted the best explanation is probably at https://bugzilla.gnome.org/show_bug.cgi?id=733423.

$COLORTERM should not be necessary ever. Instead of bringing it back, the distro should rather fix whoever relies on this to use better methods (e.g. xtermcontrol or equivalent; or $VTE_VERSION) instead.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

In https://github.com/GNOME/gnome-terminal/commit/1d5c1b6ca6373c1301494edbc9e43c3e6a9c9aaf I've found that you're most worried how you'll set TERM=xterm-256color.

As pointed out in the links above, checking for $VTE_VERSION could be one approach.

Note that vte-0.40 (gnome-terminal-3.16) will default to TERM=xterm-256color (commit 82a8b06). It might be the best move for Ubuntu to backport this patch to its current vte packages.

Revision history for this message
DipSwitch (nick-ds) wrote :

This flag is used to 'upgrade' from xterm to xterm-256color in almost every bash environment people use...

$VTE_VERSION will also be dropped from version 3.15 onwards: https://github.com/GNOME/gnome-terminal/commit/71de106ca360854d63739a015278452085eeb19b

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> This flag is used to 'upgrade' from xterm to xterm-256color in almost every bash environment people use...

Then these should be fixed.

COLORTERM's semantics have nothing to do with 256 color support per se, it was a mere coincidence that all terminals that set this variable also supported 256 colors.

And as I said, this upgrade won't be necessary beginning with the next major VTE release, which defaults to xterm-256color. I recommend that Ubuntu backports this change.

Rest assured, VTE_VERSION is not dropped. I'm using vte+gnome-terminal from git HEAD, and it's still set. I'm not sure what that commit is about, it must be something about how the command line "gnome-terminal" process connects to the running "gnome-terminal-server" or starts it up, or something like that, I'm not familiar with that area of the code. This might be about purging a previous value, but then later the correct one is set.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
Revision history for this message
Johan Boule (johan-boule) wrote :

Can we make it so the new VTE release appear in Ubuntu 15.04 ?

Changed in gnome-terminal (Ubuntu):
status: Confirmed → Opinion
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote (last edit ):

I've just found a link to this ancient bugreport in https://en.wikipedia.org/wiki/ANSI_escape_code.

Unfortunately this discussion here contains two confusing mistakes. I'd like to correct them for future reference purposes. No action necessary, other than perhaps closing this bug, and fixing the Wiki page (I might do the latter – update: done).

In comment #1 I was mistakenly talking about the COLOR*FGBG* variable, not about COLOR*TERM*. This can be seen by the link pointing to an issue that actually (correctly) talks about COLORFGBG, and from my words over here not making any sense. I probably made the same mistake in #4 too (but I'm not sure). I must have had that other environment variable in mind and talked about that, incorrectly typing the name of the one this bugreport was talking about, not realizing the difference. My bad, apologies for this mistake. (I'm not editing the earlier posts here because then the thread will make even less sense.)

COLORTERM used to be set to the terminal emulator's name, "gnome-terminal" in our case. This was removed from GNOME Terminal version 3.14, released in 2014, the commit is linked from comment #2 here. This version of GNOME Terminal (or rather, the corresponding VTE version) also implemented truecolor support. Around this time the de facto use of this environment variable across various terminal emulators shifted for it to contain the "truecolor" string if the emulator supported this feature. So VTE 0.44, corresponding to GNOME Terminal 3.20, released in 2016 brought back this environment variable with the new value in https://github.com/GNOME/vte/commit/1dea919b9aa4b55e2c5c07bf2022769cbac365b5. Since the setting now occurs in VTE rather than GNOME Terminal, it is set in all VTE-based emulators. It has stayed ever since and is likely to stay as long as this variable is in widespread use.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.