At work I am using Ubuntu GNU/Linux 14.04. When I open a new tab in the gnome terminal, the working directory of the new shell is the same as in the terminal where I have pressed CTRL-SHIFT-T.

At home I have Debian Wheezy, and here the default behaviour is to open the new shell in my home directory. I cannot find any documentation as to how to change this behaviour: I would like to have the Ubuntu behaviour on Debian.

Is this feature configurable at all or is it hard-coded, with different versions providing different behaviours? I have read the documentation and searched for a question on stack exchange but I could not find any information.


I have looked into my .bashrc and indeed there was some complicated setup that ended up changing / resetting the path. So, I have come one step further but I still have one problem, which is illustrated in this still unanswered question: if the path I am in uses some symbolic link, then the new shell uses the canonical path. Is there a known fix for this problem?

  • There is probably a difference between the various .profile or .bashrc. I would definitely look there. – T0xicCode Jan 13 '15 at 17:57
  • @T0xicCode no, it's not. This is a gnome-terminal configuration question, not a matter of which PATH is set where. – MattDMo Jan 13 '15 at 18:01

Note: I have not tried this myself because I don’t experience this problem; of course feel free to edit this answer if changes are necessary.

This is reported as a bug in Ubuntu Gnome, but I’m not surprised it also affects Debian. The solution appears to be adding . /etc/profile.d/vte.sh to the end of your ~/.bashrc or ~/.zshrc (depending on whether you use Bash or ZSH).

Note that if you already have a PROMPT_COMMAND set in Bash, this will replace it; I believe in that case you need to set your custom PROMPT_COMMAND after the added line, and in there be sure to call __vte_prompt_command. Again, though, I have not tried this and some experimentation may be required.

  • Thanks for the hint. However, there is no file /etc/profile.d/vte.sh on my system (Debian Wheezy). – Giorgio Jan 16 '15 at 17:40
  • I believe this is the right file. I’m surprised it’s not supplied by GNOME terminal or one of its dependencies. You might just want to put it in your user directory instead of /etc/profile.d, in case something else does supply it. I don’t know how Debian would deal with that. – Daniel H Jan 17 '15 at 6:50
  • 1
    Ok, found it. Unfortunately it does not solve the problem: my new shell is opened in /local/home/giorgio instead of /home/giorgio. – Giorgio Jan 17 '15 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.