files icon indicating copy to clipboard operation
files copied to clipboard

Executables often fail due to not being launched in the CWD.

Open ChildishGiant opened this issue 3 years ago • 5 comments

What Happened?

When trying to launch a steam game (just an example) from the executable files seems to do nothing but when ran with the terminal you can see this error: /home/allie/.local/share/godot/app_userdata/Luck be a Landlord/install folder/Luck be a Landlord.x86_64: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory

This is because it's being launched with its full path instead of with the CWD (I think). Opening in Gnome Files works just fine so I imagine they run from the CWD.

Steps to Reproduce

I obviously can't share the example I'm using here so have this screen recording

https://user-images.githubusercontent.com/13716824/153735767-885d4922-df5f-47d5-84d6-7cd6afd6d98b.mp4

Expected Behavior

Ideally run executables from the current folder, not their full path or at least show a message when an executable returns non-0 exit code. The former would actually solve the issue and I imagine be easier since there'd be no new UI.

OS Version

6.x (Odin)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

ChildishGiant avatar Feb 13 '22 02:02 ChildishGiant

Looks like both Gnome Files and elementary Files use GAppInfo.launch () but one difference is that Gnome Files creates an AppLaunchContext to pass to that function whereas elementary Files passes null.

What is the simplest test case for this issue (I do not have Steam games)?

jeremypw avatar Feb 13 '22 10:02 jeremypw

What is the filetype and permissions of the executable used in the screencast?

Note that elementary Files rather discourages launching executables compared with other file managers for security reasons. E.g. desktop files are deliberately not treated as executables but as text files. Also it looks like scripts that output to a terminal do not have a terminal launched automatically.

jeremypw avatar Feb 13 '22 11:02 jeremypw

#2011 might fix this - if you are able could you try it out?

jeremypw avatar Feb 13 '22 12:02 jeremypw

What is the filetype and permissions of the executable used in the screencast?

application/x-executable, 775

What is the simplest test case for this issue (I do not have Steam games)?

I'll see if I can find/make something :smile:

ChildishGiant avatar Feb 14 '22 17:02 ChildishGiant

Have you tried adding your Steam executable folder to your $PATH environment variable?

jeremypw avatar Feb 17 '22 20:02 jeremypw