bug: need to escape spaces when invoking nautilus #23

Closed
genodeftest opened this Issue Mar 17, 2013 · 2 comments

2 participants

@genodeftest

Sorry, forgot to add description

If my project is located in a folder containing spaces or in a subfolder of a folder containing spaces, nautilus can not open the folder because it splits up the path.

Example:
project is located at "/home/user/A B/C D/"
as with 1.4.0 nautilus will be started with this command:

nautilus "/home/user/A B/C D/"

which is incorrect since all spaces need to be escaped to

nautilus "/home/user/A\ B/C\ D/"

instead of opening the correct path, nautilus tries to open 4 folders:
/home/user/A
/home/user/B
/home/user/C
/home/user/D
since every non-prefixed path is interpreted as path within ~ (/home/user/)

@basti1302 basti1302 was assigned Mar 21, 2013
@basti1302
Collaborator

I've uploaded a new version, which should fix this issue. Could you please install 1.4.0 and verify the fix?

Actually, the problem could not be fixed by simply adding escape backslashes. For the record, the solution was to use

http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exec%28java.lang.String[],%20java.lang.String[],%20java.io.File%29

instead of

http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exec%28java.lang.String,%20java.lang.String[],%20java.io.File%29

Otherwise, Runtime.exec splits the command string at every whitespace before even handing it over to the shell - no amount of wrapping or escaping will help that.

@basti1302 basti1302 closed this Mar 24, 2013
@genodeftest

Fixed. Thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment