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 110407 - Wrong working directory for executed programs ($HOME instead of working directory)
Wrong working directory for executed programs ($HOME instead of working direc...
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
2.6.x
Other Linux
: Normal major
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 45917 130703 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-04-09 19:33 UTC by Daniel Eriksson
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6


Attachments
Proposed Patch (chdir to view directory) (1.12 KB, patch)
2004-05-21 00:27 UTC, Martin Wehner
none Details | Review

Description Daniel Eriksson 2003-04-09 19:33:17 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.
Comment 1 Dave Bordoley [Not Reading Bug Mail] 2003-04-20 03:42:08 UTC
2003-04-16  Alexander Larsson  <alexl@redhat.com>
Update libegg stuff.
Among other stuff this makes nautilus scripts execute in the
right directory.         
Comment 2 Daniel Eriksson 2003-04-21 13:01:47 UTC
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.
Comment 3 Matthew Gatto 2004-01-06 23:01:25 UTC
*** Bug 130703 has been marked as a duplicate of this bug. ***
Comment 4 Matthew Gatto 2004-01-06 23:03:18 UTC
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.
Comment 5 Daniel Eriksson 2004-03-07 14:21:05 UTC
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.
Comment 6 Martin Wehner 2004-05-14 01:10:57 UTC
*** Bug 142497 has been marked as a duplicate of this bug. ***
Comment 7 Martin Wehner 2004-05-20 23:25:53 UTC
*** Bug 45917 has been marked as a duplicate of this bug. ***
Comment 8 Martin Wehner 2004-05-20 23:31:37 UTC
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.
Comment 9 Martin Wehner 2004-05-21 00:27:32 UTC
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.
Comment 10 Eugenia Loli-Queru 2004-05-21 00:34:26 UTC
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 )
Comment 11 Martin Wehner 2004-05-21 01:23:56 UTC
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.
Comment 12 Eugenia Loli-Queru 2004-05-21 03:22:04 UTC
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!
Comment 13 Martin Wehner 2004-05-22 02:13:29 UTC
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.