Vscode: Windows: Code opening cli.js when run as Administrator

Created on 26 Feb 2020  路  22Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.42.1
  • OS Version: Windows_NT x64 10.0.18363

Steps to Reproduce:

  1. Open pwsh in windows terminal
  2. Go to any folder
  3. Run code . in the folder

Does this issue occur when all extensions are disabled?: Yes

Troubleshooting steps:
Uninstalled and Reinstalled VSCode. <= This actually fixed the issue on another computer, but not my main work computer.
Followed any other steps in #69373, #88432, #89088

The reason you don't see the wait in the terminal for the first 3 code . commands is because there was already a vscode window open, however, the cli.js was still opening in these instances. The terminal wait logging came back after closing all vscode instances.
image

Nobody else got you the command line for the process, so here it is with some privacy censors. Some of the processes had really, really log command line args so I couldn't get them all to fit in my Task Manager window....
image

bug help wanted windows workbench-os-integration

Most helpful comment

This problem is somehow related to kite, i closed Kited.exe process and the cli.js stopped running.

At least for me.

All 22 comments

The cli.js keeps opening up over and over. Even with VSCode closed.

It's also happening when writing code, which is making not viable to use VSCode.

I've seen 3 threads opened with the same description lately and all of those are being closed with the justification that not enough info given.

Somebody even posted a video of the occurence... Come on guys...

image

This is the printscreen from ProcessHacker

@zikhan Can you show me your %PATH% variable?

_user.name_ is my Windows user name

C:\Windows\System32
C:\Windows
C:\Windows\System32\wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
C:\ProgramData\chocolatey\bin
C:\Program Files (x86)\GnuPG\bin
C:\Program Files\dotnet\
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\
C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE
C:\Program Files (x86)\GnuWin32\bin
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
C:\Go\bin
C:\Program Files\Intel\WiFi\bin\
C:\Program Files\Common Files\Intel\WirelessCommon\
C:\Program Files\Amazon\AWSCLI\bin\
C:\Program Files\nodejs\
C:\Program Files\PowerShell\6\
C:\Program Files\Docker\Docker\resources\bin
C:\ProgramData\DockerDesktop\version-bin
C:\Program Files\Git\cmd
C:\Users\user.name\AppData\Local\Microsoft\WindowsApps
C:\Users\user.name\.dotnet\tools
C:\Users\user.name\AppData\Local\Microsoft\WindowsApps
C:\Users\user.name\go\bin
C:\Program Files (x86)\Nmap
C:\Users\user.name\AppData\Roaming\npm
C:\Users\user.name\Documents\PowerShell\Scripts
C:\Users\user.name\AppData\Local\Programs\Microsoft VS Code\bin

More useful information:
image
image

image

I managed to capture the command lines for the process also.

If that's of any help.

The cli.js file itself is opening with the following:

"C:\Users\Arthur\AppData\Local\Programs\Microsoft VS Code\Code.exe" "C:\Users\Arthur\AppData\Local\Programs\Microsoft VS Code\bin\..\resources\app\out\cli.js" --list-extensions

@zikhan Can you reproduce in a regular Command Prompt?

yep
image

im experiencing the same issue. it just randomly opens when im using the ide. thats it. doesnt matter what im doing. the tab just opens. any followup? I will note that i noticed the issue appear after i installed the Darkula Pycharm Theme although i can not for certain confirm it is the cause of the issue.

Update: its gotten so bad, the ide opens on its own. i didnt even have the application open and it did it itself wtf.

@Directory

I tried all possible fixes without success, and as nobody from the vscode team provide a proper workaround i just installed the insider version, changed the .cmd to code and i'm using it as it was the stable release of VSCODE.

Funny as it is, the trigger doesn't happen on the "unstable" version of the software.

I hope it keeps that way.

I imported all the extensions using the Settings Sync and am having zero issues right now.

i think i solved it. it happens when you set the code.exe as administrator in the comaptibility options. disabled it, reboot, no more cli.js.

at least for me.

@Directory you might be on to something here!

I was experiencing the same issue, and has VS code set to always run as administrator for all users.

  • I changed Code.exe to not run as administrator and the issue stopped. With that same setting, I opened Code as administrator and the issue still did not occur.
  • I changed Code.exe back to run as administrator for all users again, and the issue began occurring again!
  • I changed Code.exe to run as administrator just for me (not all users), and the issue occured.
  • Just in case it's useful, I'll also note that I observed this behavior (VS code trying to open cli.js) repeatedly when trying to open Anaconda navigator.

Its important for me to run VS Code as administrator for various reasons, so the workaround of _always_ opening VS code as administrator manually doesn't feel like a tenable solution.

yea vscode is important to run as admin for me too. for example i do everything in admin cmd like install pip packages. tried to install some libs via vscode terminal and it wouldn't work since its not an admin terminal. this is only a minor inconvenience. some other file write permissions too. it wont hinder me too much since my development purposes are just updating some code, pushing it, and then winscp'ing it to my server and restarting the scripts. rarely do i actually need to run my code on in the ide. still a stupid bug. hope this discovery helps the devs fix this repeatedly neglected issue.

so the workaround of always opening VS code as administrator manually doesn't feel like a tenable solution.

wait, are you saying that the issue does not occur when manualy opening vscode as admin? only when set in the compatibility property's?

This problem is somehow related to kite, i closed Kited.exe process and the cli.js stopped running.

At least for me.

wait, are you saying that the issue does not occur when manualy opening vscode as admin? only when set in the compatibility property's?

Sorry for the delay, but yes, when I just open it as adminstrator manually (rather than setting it to always open as administrator), the issue does not occur for me.

This problem is somehow related to kite, i closed Kited.exe process and the cli.js stopped running.

At least for me.

Same for me

I do remember using kite so yes, this must be a bug in kite not a bug in vscode.

I don't have the Kite extension installed fyi

I also began experiencing this issue when I installed Kite. VSCode would open up cli.js while I was in the middle of editing other files. I uninstalled Kite and restarted my machine and the issue stopped happening.

Exactly the same for me: It stopped when I unistalled Kite from the program files as well as from vsc-extensions.

I've encountered the same issue when changing the Code.exe to run as administrator.
However, if I change the setting in the file shortcut Visual Studio Code alternatively, this issue never happens again!

I have the same problem as OP, and I don't have kite

Was this page helpful?
0 / 5 - 0 ratings