Color palette resets to default upon losing focus
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:
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:
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.
DistroRelease: Ubuntu 12.10
Package: gnome-terminal 3.6.0-0ubuntu1
Uname: Linux 3.5.0-34-generic i686
Date: Sat Jun 15 09:25:32 2013
InstallationDate: Installed on 2009-12-14 (1278 days ago)
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
UpgradeStatus: Upgraded to quantal on 2012-10-18 (239 days ago)
|Changed in gnome-terminal (Ubuntu):|
|status:||Confirmed → Triaged|
|importance:||Undecided → Medium|