GNOME Bugzilla – Bug 591145
Starting gnome-shell messes with the terminal start dir
Last modified: 2009-08-08 16:52:05 UTC
Please describe the problem: To run gnome-shell, I do the following: 1. open gnome-terminal => it loads in dir $HOME, which is fine 2. cd gnome-shell/source/gnome-shell/src 3. ./gnome-shell --replace Now I can have fun with gnome-shell and take a preview of what the future brings us. When I'm done and I want to go back to my usual gnome session, I just CTRL+C in the terminal running gnome-shell. This kills it, and the usual components come back (metacity, gnome-panel,...). However, if I now open a new gnome-terminal (with ALT+F2, with the menu, etc.), it will load in the folder ~/gnome-shell/source/gnome-shell/src. This persists until restarting the whole GNOME session. I reproduced the bug with xterm as well. Steps to reproduce: Actual results: Expected results: Start dir of the terminal should not be changed. Does this happen every time? Yes Other information: In case that's needed: gnome-terminal-2.26.3.1-1.fc11.x86_64 xterm-242-3.fc11.x86_64 I'm running commit ccafa53bd62a63d81adc20f554518ac2a6019204 of gnome-shell.
Created attachment 140203 [details] [review] Change to $HOME at the beginning of the wrapper Change to $HOME wat the start of the gnome-shell Python wrapper. This doesn't currently matter for the shell itself, because Mutter changes directory to $HOME anyways, but it's important when we relaunch the panel in --replace mode. Reported by Mathieu Bridon
Just tried the attached patch. I can confirm that this fixes the issue. That was quick! :)
The patch looks good to me, and fixes the issue without problems here too. Thanks!
After further working with it, it seems like the patch makes it impossible to run custom scripts from ~/gnome-shell/source/gnome-shell/js. Comments from Owen on IRC: <owen> Quite possible <owen> it probably broke <owen> bin_dir = os.path.dirname(os.path.abspath(sys.argv[0])) <owen> if os.path.exists(os.path.join(bin_dir, 'gnome-shell.in')): <owen> can you comment that on the bug as well? <owen> sanderd: The simplest thing is probably just to chdir before respawning stuff at the end <owen> rather than doing it upfront
Created attachment 140211 [details] [review] Change to $HOME before launching gnome-panel again When exiting from --replace mode, we want to start the new gnome-panel with a reasonable working directory so that if, you say, open a terminal from it it doesn't start off in the gnome-shell directory. (gnome-shell itself is running in $HOME because mutter changes directory itself at startup.) Reported by Mathieu Bridon
And again for this patch, this fixes the issue. Hope this time it doesn't create another one :)
Pushed, think it should be pretty safe :-) Thanks for the review/testing, Sander.