This is a feature of gnome-terminal that everyone seems to like but me and thillai-selvan. There is a lot of documentation on how to fix it when it's not working right (that is, when a new tab is opening in the same directory as the previous tab). However, there is little information on how to disable the feature. It can't be disabled in the gnome-terminal UI or any config files as far as I can tell. So you need to break it or circumvent it.
For my use case, echo 'cd $HOME' >> ~/.bashrc
is not a good solution, because in some applications I would like them to be able to open in a different directory, mainly the embedded terminal in vscode, and that line in bashrc will prevent it.
The feature is implemented by providing a PROMPT_COMMAND that records the current directory every time a prompt is generated. Current versions of gnome implement this by installing a vte
script into /etc/profile.d
. You should be able to remove that file (back it up so you can restore it later if you want) and disable this feature.
Same problem, I'd like the old behavior. No options in dconf. - From user1585507
– Canadian Luke – 2013-05-03T20:56:16.893