GNOME Bugzilla – Bug 110407
Wrong working directory for executed programs ($HOME instead of working directory)
Last modified: 2004-12-22 21:47:04 UTC
I just installed Gnome 2.2 and discovered that the working directory of any scripts executed from Nautilus is not the directory that is open in Nautilus (as it was in Gnome 2.0) but my home directory, which really messes most of my scripts up.
2003-04-16 Alexander Larsson <alexl@redhat.com> Update libegg stuff. Among other stuff this makes nautilus scripts execute in the right directory.
Excuse me if this is a stupid question, but where do I find that then? I have a (almost) clean RHL 9 system, and there doesn't seem to be any libegg on my system.
*** Bug 130703 has been marked as a duplicate of this bug. ***
daniel@brockman.nu pointed out in bug 130703 that this isn't fixed in CVS HEAD as of 2004-01-06, so REOPENING and updating fields.
Well, this _was_ fixed in the 2.4 series almost a year ago but now it seems to be back. In 2.5.8 the working directory is wrong again.
*** Bug 142497 has been marked as a duplicate of this bug. ***
*** Bug 45917 has been marked as a duplicate of this bug. ***
Ok, confusion. This bug is not about nautilus scripts, but apps & scripts launched via double-click or 'open with'. It works as expected for nautilus scripts.
Created attachment 27894 [details] [review] Proposed Patch (chdir to view directory) This patch makes Nautilus chdir to the directory of the view the program/script is launched from prior to executing it.
Martin, this has being discussed in the mailing list, Dave Camp's email is of particular interest: http://lists.gnome.org/archives/nautilus-list/2004-February/msg00213.html Does your patch takes into account the "Run Dialog"? (discussion starts here: http://lists.gnome.org/archives/nautilus-list/2004- February/date.html#00212 and also continued here: http://lists.gnome.org/archives/nautilus-list/2004-May/date.html#00080 )
Oh. Well, my patch doesn't change anything with regard to the run dialog as it's not part of Nautilus. The only thing it changes is that it temporarily changes the working directory for launched apps to the directory being viewed. That's the behaviour Dave suggested, what is currently done for nautilus scripts and I think is what everyone would expect.
I tested your patch. It works great with all kinds of executables (including python, Fox-toolkit, java, shellscripts, Wine apps, executables on $PATH and out of it, etc etc), *but* it doesn't work with Mono executables (which was the main reason I filed a bug report in the first place). :( Normally, Mono apps should load as "mono app.exe", which is the same as "wine app.exe" from the command line (both work fine from the command line). I have set the .exe files on Gnome's MIME db to either open with WINE or Mono (I select it each time from Nautilus' context menu) but while WINE apps work, Mono's don't. :( If you have Mono beta 1 installed, please download the latest CSBoard (Freshmeat) and/or gSkyNet (from Sourceforge) apps which they run from their working folder (they don't have a "make install" option so you are bound to run them from their folder) to test with them. If this is fixed (it just seems that Mono requires more variables set, not just the cwd option), then the patch should be commited. Thx!
Fixed in CVS. Eugenia, thanks for the feedback - I'll look into what's missing to make mono apps run from Nautilus. But the original issue of this bug is fixed, so I'm going to close it; This bug is confusing enough as it is. If you feel strongly about it, please open another bug about it.