1

After upgrading Ubuntu from 19.04 to 20.04.1, gnome-terminal always opens with / as working directory when lanched by name at a command prompt or in a desktop file, but NOT when launched from a button 'preferenced' to the dock or from the applications menu.

I had (and still have) a shortcut on my desktop that should open a terminal in a project directory, with this command in the .desktop file:

Exec=gnome-terminal --working-directory="~/git/ams-rpicm"

It still opens a terminal window like it used to, but with "/" as working directory.

Launching instances of gnome-terminal from another terminal window, I found that it's always the same, whether I include the --working-directory switch or not, and whatever path I specify in that switch: it always opens with "/" as working directory.

Does anyone have an idea what might cause this? It worked as expected in 19.04 just an hour ago.

The answer in open in terminal is not working after upgrading to 19.10 doesn't apply here, I already checked that.

Luc VdV
  • 163

1 Answers1

0

It appears that things have changed. You cannot use the bash-tilde expandion. Moreover, you cannot use a relative path.

To workaround the issue, do not use bash tilde expansion. Instead use an absolute pathname or an environment variable, provided it is available.

Thus, expand the tilde by the full pathname, as

Exec=gnome-terminal --working-directory="/home/yourlogin/git/ams-rpicm"

where yourlogin is the name of your home folder, by default the same as your user name.

vanadium
  • 97,564