Ie. it contains a few spaces. But no matter what I try, KiCad can’t use that binary path. It does not work with the same way the path works in terminal.
I think I have tried single and double quotes and escaping the spaces with backslash with no luck. It also does not work I use KiCad folder browser to just select the folder. What is the proper way to do it? The error I get is Command [...] could not be found.
(I can circumvent this by using /usr/bin/open -t after I have configured VSC to be a default app for opening txt files. Still would like to be able to configure this properly.)
Some 30+ or so years the fruit brand switched from their own homebrew OS to something BSD like, and I guess that’s pretty similar to Linux and other Unix look alikes. It uses slashes for directory separation, and backslashes as escape sequences.
What I remember from KiCad, they have to struggle with path name compatibility with that other OS that puts the slashes backwards, and best I know they treat both the slashes and backslashes as directory separators. So you could try removing the slashes, and let KiCad handle the spaces to translate them for your OS.
But overall, I prefer simplicity and reliability, and personally I agree with 3Dogs. I don’t use spaces in file paths or names myself, and especially not for development tools.
Not unhealthy at all. Slash is the folder separator and backslash is an escape character to address the spaces. In macOS you can write a path with spaces in it in multiple ways when accessing them in terminal
. For example:
cd "/dir/folder with spaces/"
cd '/dir/folder with spaces/'
cd /dir/folder\ with\ spaces
But if nobody has any hints, I’ll probably just file a bug report.
Thanks but my question was specifically about spaces in the pathname and not about the default string (which works just fine). This is not about the space between the command open and the arguments -e. But thanks.
Me neither, but the path I posted is the default path VSC installs itself. And only KiCad has had issues with the path. So looks like a bug in KiCad to me.
Try with:
/Applications/‘Visual Studio Code.app’/Contents/Resources/app/bin/code
That’s the most universal way to me.
(why Apple uses spaces in a directory name, and then ends it with “.app” is somewhat schizoid. But OK, what do I know?)
Ah!?
Perhaps it should be:
/Applications/‘Visual Studio Code’.app/Contents/Resources/app/bin/code
Although that would be even stranger.
Thanks, but already tried those with no luck. I was hoping someone actually knew how to refer to path names with spaces.But maybe it is not possible at all.
Oh, and the path name actually comes from the application name. So there really is no way to bypass this. KiCad has to support paths with spaces in order to be able to use many non-default text editor applications on macOS.
The thing is space is a legal character in Unix filenames (of course) and the OS API. Convolutions with space and other characters are usually to do with getting the name past the shell which is commonly used to invoke external commands, as well as any quoting the app may apply to strings.
One thing not tried yet is to double the backslash in case there are two levels of escaping.
If I were you I’d just write a shell script that does this, and use it as the editor path:
exec /Applications/'Visual Studio Code.app’/Contents/Resources/app/bin/code "$@"
All one line. That “$@” should be written exactly like that, it’s a shell idiom. The exec is to save one process.
This was a nice idea and actually did work! (As long as one remembers to give +x permissions to that file.)
I think I’ll file the bug report as configuring the editor should work just by selecting the binary and without writing additional scripts. But thanks anyway, this is one possible workaround