Command line 从命令行开始的Visual Studio代码批打印输出;更新“设置状态”;每小时
我的那批看起来像这样Command line 从命令行开始的Visual Studio代码批打印输出;更新“设置状态”;每小时,command-line,visual-studio-code,Command Line,Visual Studio Code,我的那批看起来像这样 @Start "VisualStudioCode" "C:\Program Files\Microsoft VS Code\Code.exe" %* 在命令窗口中,我每小时都会收到一条消息: [main 12:14:41] update#setState idle [main 13:14:39] update#setState checking for updates [main 13:14:40] update#setState idle [main 14:14:39]
@Start "VisualStudioCode" "C:\Program Files\Microsoft VS Code\Code.exe" %*
在命令窗口中,我每小时都会收到一条消息:
[main 12:14:41] update#setState idle
[main 13:14:39] update#setState checking for updates
[main 13:14:40] update#setState idle
[main 14:14:39] update#setState checking for updates
[main 14:14:43] update#setState idle
[main 15:14:39] update#setState checking for updates
[main 15:14:41] update#setState idle
[main 16:14:39] update#setState checking for updates
[main 16:14:40] update#setState idle
[main 17:14:39] update#setState checking for updates
[main 17:14:41] update#setState idle
如何抑制这些消息?请尝试运行“C:\Program Files\Microsoft VS Code\bin\Code.cmd”,因为这是CLI版本。Code.exe是不应该在路径中的electron应用程序。我在这里结束:
@echo off
setlocal
set VSCODE_DEV=
set ELECTRON_RUN_AS_NODE=1
call "C:\Program Files\Microsoft VS Code\Code.exe" "C:\Program Files\Microsoft VS Code\resources\app\out\cli.js" -n
ping 127.0.0.1 -n 2 > nul
call "C:\Program Files\Microsoft VS Code\Code.exe" "C:\Program Files\Microsoft VS Code\resources\app\out\cli.js" %*
endlocal
我的解决方案是删除:
D:\Users\<me>\AppData\Local\Programs\Microsoft VS Code\
D:\Users\\AppData\Local\Programs\Microsoft VS-code\
从我的路径添加:
D:\Users\<me>\AppData\Local\Programs\Microsoft VS Code\bin
D:\Users\\AppData\Local\Programs\Microsoft VS code\bin
现在,当我键入“code”时,它会启动code.cmd,而不是code.exe。(我的路径是针对每个用户的版本。根据需要调整系统范围的版本)我遇到了类似的问题。在我的例子中,有效的方法是以“管理员”模式打开所有应用程序,它工作得非常好。VS代码和终端都可用。这可以正常工作,但cli版本还有一个问题。我在用户设置中设置:`“files.autogustiencoding”:false,“[bat]”:{“files.encoding”:“cp850”,“editor.tabSize”:3,“editor.detectIndentation”:false},`当vsc未运行时,我通过cli和参数“my.bat”启动它当vsc运行所有*.bat文件时,编码转到
UTF-8
。bat文件用cp850