VSCode: function "code" prevents me from running code from shell

I am installing Visual Studio Code for MacOS and have installed the command code

in a shell through a GUI.

enter image description here

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

LSGetApplicationForInfo () failed with error -10814 when trying to identify an application with package ID com.microsoft.VSCodeInsiders.

I don't know what is the reason for this. I found that a function was created code

and that if I remove it with unset code

once, I can run code

in a shell and VSCode starts correctly. Every reboot returns this function though ...

Function code

:

# 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?

+3


source to share


4 answers


The function code

was created from some other file that I used, even before installing Visual Studio Code, and then conflicted with the executable installed by the application /usr/local/bin/code

.



0


source


I have it installed on my Mac and there is no alias. I don't need to film anything. 'code' is just a script file located in `/ usr / local / bin / code

You seem to be in conflict with some other application that has set an alias for "code". I recommend that you review all the scripts that run during shell startup:



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

      

It can also help if you post the content of the code alias

+1


source


This may refer to a conflict with another application.

A few things to try:

  • Reinstall VSCode
  • Check for updates in VSCode as they recently updated their package.

This is a problem that I ran into recently and was able to resolve it by reinstalling.

0


source


A known issue occurs when you have an unintentionally outdated version where the package identifier is out of date.

Try manually updating your VS Code to get started - just make sure it's not a problem.

Make sure you are using 1.11.2

code. shortcut is disabled in OSX

EDIT: Also, I still don't know why MS uses negative signs in error codes. This is generally bad practice.

0


source







All Articles