3

I install Visual Studio Code for MacOS and installed the code command to the shell via the GUI.

enter image description here

Now, when I try to execute this command, I get the following error:

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

I have no idea what is the cause of this. I found that a function code has also been created and that if I remove it with unset code once, I can then run code in the shell and VSCode will launch correctly. Every reboot bring back this function though...

The code function is:

# type code
code is a function
code ()
{
    VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCodeInsiders" --args $*
}

What is the problem? What am I supposed to do here?

2
  • If unset code makes it work, it means you have a function named code either in system profile or in your local profile. You can still execute VSCode without unsetting the function code by running command code. This will execute the script and not the function. But I suggest getting rid of the function code. Commented Apr 14, 2017 at 0:42
  • I notice that the error has a mention to VSCodeInsiders. You might have more success with the stable version rather than the insider version. Commented Apr 14, 2017 at 1:32

4 Answers 4

1
+200

I have it installed in my Mac, and there is no alias. I do not need to unset anything. 'code' is just a script file, residing in `/usr/local/bin/code

It seems you have a conflict with some other application that has set an alias for 'code'. I recommend you look at all scripts that are run during shell startup:

~/.bash_profile
~/.bash_login
~/.profile
~/.inputrc
/etc/profile

It could also help if you post the content of your code alias

Sign up to request clarification or add additional context in comments.

2 Comments

When a command can resolve to multiple paths and aliases, in order to determine which one is the option picked by the shell, use the type code command. If it is an alias, it shouldn't. Check why is it.
glad it worked! using code from the command line is very helpful.
1

The code function was created from some other file I was using before even installing Visual Studio code and was then conflicting with the executable installed by the app under /usr/local/bin/code.

Comments

0

This may relate to a conflict with another application.

A couple things to try:

  • Reinstall VSCode
  • Check for Updates in VSCode since they recently updated their bundler.

This is an issue I recently ran into and was able to resolve through reinstallation.

Comments

0

There is a known issue that occurs when you have an unintentionally outdated version where the bundle identifier is outdated.

Try manually updating VS Code to get started- just to be sure this isn't the issue.

Be sure you are running 1.11.2

code . shortcut fails on OSX

EDIT: Also, I still don't know why MS use negative signs in error codes. It's generally bad practice.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.