Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After upgrading to Ubuntu 11.04, my terminals (gnome-terminal and urxvt) start in "/" instead of "~"

What can cause this behavior?

I imagine that the working directory of Gnome or X is set to "/", or something like that, but I have no idea on where to start debugging this.

I use zsh, config can be included.

share|improve this question
you could try dirs -v to find out whether the last entry comes from some pushd after $HOME in some way. Just a thought. – Alain Pannetier May 2 '11 at 16:15
up vote 5 down vote accepted

I assume you see this behavior when opening the terms with custom keyboard shortcuts while they start in the right directory if opened via the menu or the Run Application dialog.

Curiously programs you define under the Custom Shortcuts section of the Gnome Keyboard Shortcuts dialog don't seem to inherit the session working directory. Knowing nothing about the reasons, I suspect this is a bug.


  • Use the Run a terminal shortcut in the Desktop section and set your preferred terminal emulator under System => Preferences => Preferred Applications => System => Terminal Emulator,

  • Set the keyboard shortcut to a wrapper script, e.g.

    exec rxvt -cd $HOME
  • Define the shortcut to include setting the working directory, e.g.:

    gnome-terminal --working-directory=$HOME


    rxvt -cd /path/to/home

    (The latter doesn't work with $HOME for me; I had to give the absolute path.)

share|improve this answer
100% Correct! Thanks! I fixed it by using compiz' keyboard shortcuts instead. Very good suggestions. (The run application dialog actually behaves as it should in ubuntu natty) – Joernsn May 16 '11 at 6:33

You could try to put cd at the end of your ~/.zshrc.

share|improve this answer
Zsh is my default shell. Wouldn't this screw up scripts expecting cwd to be something else?? – Joernsn May 16 '11 at 6:33
Scripts expect to be in the home folder at startup. – cYrus May 16 '11 at 11:16

A couple of things to check:

  1. Your home directory is set properly (cd ~ takes you home ok)
  2. The partition that contains your home directory is mounted and usable at the time GDM logs you in.

I had a similar problem using ZFS and having my home on a ZFS pool. ZFS wasn't starting before GDM so when it logged me in my home dir wasn't there. A few seconds later it was there though, so I could cd to it.

share|improve this answer
Good suggestions! 1: If i login outside X, everything works, so it seems that $HOME at least is correct there. "echo $HOME" is also correct in the terminal emulators. 2: I've tried restarting GDM after making sure everything's mounted, without luck :( – Joernsn May 4 '11 at 8:41

I solved my problem adding a cd command at the end of my ~/.bashrc

cd /your_desired_path

After that, everytime you invoke the console that uses .bashrc will be prompting at your desired path.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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