After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 591145 - Starting gnome-shell messes with the terminal start dir
Starting gnome-shell messes with the terminal start dir
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal minor
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-08-08 12:53 UTC by Mathieu Bridon
Modified: 2009-08-08 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change to $HOME at the beginning of the wrapper (1.17 KB, patch)
2009-08-08 14:48 UTC, Owen Taylor
reviewed Details | Review
Change to $HOME before launching gnome-panel again (1.19 KB, patch)
2009-08-08 16:19 UTC, Owen Taylor
none Details | Review

Description Mathieu Bridon 2009-08-08 12:53:41 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.
Comment 1 Owen Taylor 2009-08-08 14:48:32 UTC
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
Comment 2 Mathieu Bridon 2009-08-08 14:59:56 UTC
Just tried the attached patch.

I can confirm that this fixes the issue.

That was quick! :)
Comment 3 Sander Dijkhuis 2009-08-08 15:06:45 UTC
The patch looks good to me, and fixes the issue without problems here too. Thanks!
Comment 4 Sander Dijkhuis 2009-08-08 15:45:27 UTC
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
Comment 5 Owen Taylor 2009-08-08 16:19:29 UTC
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
Comment 6 Mathieu Bridon 2009-08-08 16:28:46 UTC
And again for this patch, this fixes the issue.

Hope this time it doesn't create another one :)
Comment 7 Owen Taylor 2009-08-08 16:52:05 UTC
Pushed, think it should be pretty safe :-) Thanks for the review/testing, Sander.