3

I installed VS Code and run the Shell Command: Install 'code' command in PATH as per documentation (and as found in this answer)

At first it was working, but after a reboot (I suppose) I couldn't get code started from a terminal (which is pretty useful).

This is the error I get:

LSGetApplicationForInfo() failed with error -10814 while trying to determine the application with bundle identifier com.microsoft.VSCodeInsiders.

Not sure if helpful: if I type which code I get /usr/local/bin/code.

2 Answers2

2

One possible solution for this is to do the following:

  1. Open the terminal
  2. Find the path of the OS X app that you're having this problem with
  3. Run the following command: mdls -name kMDItemCFBundleIdentifier -r <app-path>

The bundle name that's returned by this will be the actual name of the bundle (which com.microsoft.VSCodeInsiders is not.)

You can then open the application by typing open -b <bundle-name> with whichever args afterwards.

Hints:
- Your <app-path> might contain spaces, in which case you should surround it with " (quotes). - The <app-path> is the path to the directory that ends in .app -- the path of the "icon" you see in the finder for the application. In the terminal, the name of the folder will end with .app.

Marco
  • 8,958
  • 1
  • 36
  • 56
0

The solution above from marco worked, so to make it more friendly, I've added to my ~/.aliases

alias code='open -b com.microsoft.VSCode'

Then, again I can code . and open the vscode in my current path.