microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.56k stars 28.13k forks source link

App sends output to command line #102014

Closed luishmsft closed 3 years ago

luishmsft commented 4 years ago

Issue Type: Bug

If VS Code is not running, and I launch a a file with an extension that is associated VS Code (e.g. source.c) from my Razzle command line, then VS Code opens and from then on VSCode diagnostic messages may randomly appear in the command line, for example:

(node:26676) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information (node:26676) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information (node:26676) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information (node:26676) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information (node:21192) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information (node:21192) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information [main 2020-07-09T16:54:43.091Z] update#setState checking for updates [main 2020-07-09T16:54:43.124Z] update#setState idle

It is not critical, but it can cause issues if I'm interacting with the command line when the app decides to output a diagnostic message.

The workaround is to make sure I launch VS Code before trying to edit any source file. But because this was never a problem with my previous source editor (Source Insight) I've developed a strong habit to launch the source app from my razzle window.

VS Code version: Code 1.46.1 (cd9ea6488829f560dc949a8b2fb789f3cdc05f5d, 2020-06-17T21:13:20.174Z) OS version: Windows_NT x64 10.0.20167

System Info |Item|Value| |---|---| |CPUs|Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz (12 x 3492)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|31.92GB (15.10GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (4) Extension|Author (truncated)|Version ---|---|--- devinsights|Mic|2020.5.7-2 vscode-nmake-tools|Mic|3.0.200603007 remote-wsl|ms-|0.44.4 cpptools|ms-|0.29.0-insiders2
pplmx commented 4 years ago

I'm not sure this is a vscode issue. For me, It produced after I upgraded git to 2.27(Default git editor is VSCode) Two scenario I encountered:

bpasero commented 4 years ago

This looks like you are running Code.exe directly which we do not encourage.

luishmsft commented 4 years ago

Thanks for taking a look. What is the suggested steps to associate files with vscode? The reason code.exe is launched is because I typed the source filename (e.g. - source.c) from the command line. Initially this will bring up the "open with" windows dialog. VsCode is not listed, which seems like an issue in itself, so I had to choose the option to find the application myself and select vscode.exe. From then on vscode is associated with the file.

joaomoreno commented 3 years ago

Inside Code's installation directory there is a bin\code shortcut which you can use for these purposes. Can you try this?

luishmsft commented 3 years ago

That seems to have resolved the issue, although it causes a CMD prompt window to open behind vscode. I'm good with this alternative, thanks.

It'd be great if vscode, on install, added itself to the list of apps that can open common source extensions. That shortcut could do the right thing under the covers.

joaomoreno commented 3 years ago

The setup does ask whether you want Code to register as the default app for certain file extensions.

luishmsft commented 3 years ago

What should the user do if they decide to make VsCode the default after installation? That was my case. I wanted to try out the app first before committing it as the default.

joaomoreno commented 3 years ago

You can always run the installation again.

luishmsft commented 3 years ago

It would be better if VSCode registered itself as a handler for common source extensions, so that it can be easily picked post install. Visual Studio does this, for example.