I just spent most of an afternoon hunting down WTF is going on with the active vs other tabs visibility for the https://developer.gnome.org/gtk3/stable/GtkNotebook.html widget, with the default theme (Raleigh), for the same reason as the OP. I Finally got tired of having it near-impossible to see which tab is active at a glance. (There is a visible difference where the active tab connects to the border, but it's too subtle to be any use).
As far as I can tell, the default theme isn't supposed to look that way, and nobody ever fixed it since it was introduced. (or just fixed it for themselves and posted on a blog or something.) I reported it as https://bugzilla.gnome.org/show_bug.cgi?id=741185.
The fix is to put this in your .config/gtk-3.0/gtk.css:
.notebook tab:active {
background-color: darker(@bg_color);
}
The reason is that https://git.gnome.org/browse/gtk+/tree/gtk/theme/Raleigh/gtk-default.css has a bug. gtk-default.css is the Raleigh theme, which gets compiled in to gtk+, so it's used if there isn't a different default set somewhere.
...
notebook .active-page {
color: @selected_fg_color;
background-color: darker (@bg_color);
}
...
That css doesn't actually do anything. "active-page" is the string https://git.gnome.org/browse/gtk+/tree/gtk/gtknotebook.c checks, but it's not the name of the appropriate CSS element, or whatever the correct noun is. Also, the color property doesn't do anything for a notebook tab.
That code came from this commit:
https://git.gnome.org/browse/gtk+/commit/gtk/gtk-default.css?id=7cd3e7c81bf82bc51f2891e332575d1fbe3dde4e
And yes, it took me maybe 10 minutes to follow that file back through 3 renames or so. Yuck. (follow the link to the diffstat to find the rename, then -> parent commit -> tree, then browse to the file. Look at the log, repeat starting from the rename commit that introduced it.)
Links I found while looking into this:
https://askubuntu.com/questions/400979/how-to-change-gtk-notebook-tabs
http://www.gtkforums.com/viewtopic.php?f=3&t=988&p=72092&hilit=Styling+a+Notebook+with+gtk3+and+css#p72092
does some funky stuff, like put rounded corners on tabs. But didn't tell me what the right syntax was for affecting the active tab. Also, IDK why they use GtkNotebook { }
instead of .notebook { }
, since either one seems to work.
http://harts.net/reece/2013/02/26/highlighting-the-active-tab-in-gnome-terminal/
indicates that you can limit the fix to just gnome-terminal, by qualifying with TerminalWindow .notebook tab:active
https://developer.gnome.org/gtk3/stable/gtk-migrating-GtkStyleContext-css.html basics of gtk's subset of CSS. e.g. // comments don't work, only /* */
If you're tweaking your CSS, the easiest way to test it is to flip to another shell and run gedit file1 file2. (with files that exist, so it won't prompt you to save them). It comes up pretty fast, and you can close it again quickly.
There is a bug related to this issue
All you need to do is add the following line to your .bashrc
or .zshrc
:
. /etc/profile.d/vte.sh
At least on Arch, the script checks if you are running either bash or zsh and exits if you are not.
Best Answer
A very simple workaround for you would be including a function in your
~/.zshrc
that remembers the working directory and changes into it when opening zsh:We use /dev/shm instead of /tmp to avoid disk writes, although /tmp could already be a tmpfs on your system.
\cd
is used to avoid a fork bomb.If you would like this feature for gnome-terminal only, you could include an if statement to check your current terminal or active window. Also, if you are concerned that other users might find out what was your last directory, you could modify the permissions for
$USER-pwd
withchmod
: