Color palette resets to default upon losing focus

Bug #1191238 reported by ais523 on 2013-06-15
This bug affects 5 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)

Bug Description

gnome-terminal understands the control codes (CSI ] 4 ; … ST) for changing the color palette available to console applications. However, when the current tab loses focus (either because the gnome-terminal window loses focus, or because I switch to a different tab), any custom color palette installed by the console application I'm using are lost, and it resets to the palette set in the profile.

Steps to reproduce:
Profile settings: "Use colors from system theme" off, "Built-in schemes": custom, any custom text and background color, any built-in color scheme. (I've tested multiple settings for the actual colors; none have an effect on the bug reproducibility. I haven't tested using colors from the system theme, or a built-in scheme, but I suspect they also don't influence whether they bug can be reproduced".

Load up bash inside the terminal, using a prompt that does not set colors, and run the following command:

printf '\x1b[91m'

This sets the foreground color to 9 (light red); the subsequent text in the terminal turns light red (this is both observed and expected behaviour).

Then run the following command:

printf '\x1b]4;9;rgb:00/00/ff\x1b\\'

This redefines color 9 to be bright blue. The subsequent text in the terminal turns bright blue (again, this is both observed and expected behaviour).

Now, switch to a different tab, or a different application, then back to gnome-terminal. (If you switch to a different application that does not overlap gnome-terminal, you can see the color change happen onscreen.) I'm on a system (Unity) where keyboard focus always follows window focus, so I'm not sure if the trigger is losing keyboard focus or window focus; if you have a different window manager, you might want to test both separately.

Expected behaviour: the bright blue text remains bright blue upon switching away from the window, and continues to remain bright blue when returning to the window. Text continues to be bright blue unless the foreground color or palette are changed again.

Observed behaviour: the bright blue text becomes light red upon switching away from the window, and continues to remain light red upon returning to the window. Text continues to be light red unless the foreground color or palette are changed again. Changing palette entries other than 9 does not cause the text to become blue again; nor does changing the foreground color away from 9 and then back to 9.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: gnome-terminal 3.6.0-0ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-34.55-generic
Uname: Linux 3.5.0-34-generic i686
ApportVersion: 2.6.1-0ubuntu11
Architecture: i386
Date: Sat Jun 15 09:25:32 2013
ExecutablePath: /usr/bin/gnome-terminal
InstallationDate: Installed on 2009-12-14 (1278 days ago)
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
MarkForUpload: True
 PATH=(custom, user)
SourcePackage: gnome-terminal
UpgradeStatus: Upgraded to quantal on 2012-10-18 (239 days ago)

ais523 (ais523) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
ais523 (ais523) wrote :

Just tested on saucy; I can still reproduce this bug.

tags: added: saucy
Daniel Hahler (blueyed) wrote :
Changed in gnome-terminal (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
Joe Mou (jmou) wrote :

I was wondering if there's anything I can do to help file this bug upstream.

The Gnome Terminal FAQ says (

If you're a developer of GNOME Terminal, VTE, or GNOME in general, you can file the bug in GNOME's bugzilla. In all other cases, you should file the bug against your Linux distribution's bug tracker

I'd be happy to file the bug upstream but I figured I would check with anyone who might understand the Gnome processes better. Is it OK for a non-developer / non-maintainer to file in Gnome's bug tracker?

Egmont Koblinger (egmont-gmail) wrote :

It's already fixed in forthcoming vte-0.36 (gnome 3.12).

ais523 (ais523) wrote :

Cannot reproduce on Trusty. I assume the change has filtered through to Ubuntu by now.

ais523 (ais523) wrote :

And still fixed on Wily. I think Ubuntu has pulled in the upstream fix and there's nothing more to change now.

Changed in gnome-terminal (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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