Shell CD Command Gnome Terminal – How to Keep Track of Directory in New Tab in Gnome Terminal

cd-commandgnome-terminalshell

I'm on Arch linux, and when I open a new terminal tab, it always goes to $HOME. How can I make it so that when I open a new tab, it opens the shell in the directory I was in previously?

Best Answer

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.

Related Question