Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename with spaces would not open in macos #144

Closed
mludovico opened this issue Apr 23, 2021 · 4 comments
Closed

Filename with spaces would not open in macos #144

mludovico opened this issue Apr 23, 2021 · 4 comments

Comments

@mludovico
Copy link
Contributor

When I try to open a file with a space in its name it would not open. I've been able to track down the problem in the macos implementation that is not aware and escaping the space in the system call. I will send a PR with a suggestion. The same would happen to linux.

@mx1up
Copy link
Contributor

mx1up commented Apr 23, 2021

see #127 , maybe also just use the Process class?

@mludovico
Copy link
Contributor Author

@mx1up you're right. I've completely missed that. That would be better than creating a parser like #145 . Are you using it directly in your code or using the tweaked plugin?
Thanks for the heads up!

@mx1up
Copy link
Contributor

mx1up commented Apr 23, 2021

my PR got merged but I guess @crazecoder thought it was safer to offer the Process route only as an option. So yes, I use the official version with the Process option enabled.

IMHO, I'm convinced every desktop environment on linux has the xdg-utils dependency (xdg-open command available), so I would just standardize on xdg-open and leave out the native system call route. You could argue though that the Process route requires spawning an extra process which impacts performance. Personally I think it's negligible.

I am not familiar with the macos environment, does it have the xdg-open command? A quick search reveals it would just be called "open". maybe you can verify.

edit: btw, on windows one could use the start command from a shell: cmd /c start <arg>

@mludovico
Copy link
Contributor Author

Because I was looking only for a MacOS solution I've ignored what did happen in linux call. It seems ok to me to create a new process specially on Mac because open is detachable. In a really quick google about xdg-open it is a blocking process. I don't know if there is some sort of arg to make it behave differently. So I really believe that the calls both for mac and linux could be using Process.runSync with the only difference being the actual command which will be open and xdg-open for mac and linux respectively. Apparently runSync method handles spaces and other things on its args parameter.

crazecoder added a commit that referenced this issue May 4, 2021
Add command parser before create system call #144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants