question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VS Code holds onto parent console when launched via command line

See original GitHub issue

Repro:

  1. Open cmd.exe
  2. Run code
  3. Switch back to cmd.exe
  4. exit

Repro’s in stable and insiderrs and does not repro in Atom which is also on Electron 2.

Advice from Windows console team:

I believe VSCode is reconnecting to its parent hosting console for debugging purposes.

Starting with @joaomoreno who might know who to send this to, not sure who the real owner is though.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:28 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
dweddig01commented, Mar 8, 2022

Any updates on this. Reading through the comments is a little confusing if this is planned to be fixed, or not. What is weird, is it use to work where running “code .” from the command line did NOT seem to hijack the PowerShell 7 session. But now it does it again. I do have a newly installed computer so there may be a behavior related to some kind of setting?

2reactions
jtnordcommented, Nov 18, 2020

Any update on this? It’s a minor but extremely annoying issue.

not really minor as your shell (cmd.exe) becomes almost useless as it has debug logs spewed to it which makes reading what you should have there almost impossible.

Note: there are people saying “use code.bat” not “code.exe” however - that workaround does not work when you use start some_file_with_type_registered_to_code. for example if you associate xml files with code via the windows explorer (always open with) and then from a cmd.exe shell run start test.xml which is pretty basic windows behaviour you get the debug messages in the console. You can not change the association to code.bat as that spawns a new console window when you open the file from explorer

Edit: sorry, just now noticed the linked PR; really appreciate you all working on it!

the upstream PR has been closed and so appears stalled for real this time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrated Terminal in Visual Studio Code
Moving a terminal into its own group can be done with the Terminal: Unsplit Terminal command through the Command Palette or in the...
Read more >
Command Line Interface (CLI) - Visual Studio Code
Visual Studio Code has a powerful command-line interface built-in that lets you control how you launch the editor. You can open files, install...
Read more >
User and Workspace Settings - Visual Studio Code
You can also open the Settings editor from the Command Palette ... whether you can drag and drop a file into a text...
Read more >
Debugging in Visual Studio Code
The top-level Run menu has the most common run and debug commands: ... VS Code keeps debugging configuration information in a launch.json file...
Read more >
Troubleshoot Terminal launch failures - Visual Studio Code
Test your shell directly. Try running your designated integrated terminal shell outside VS Code from an external terminal or command prompt. · Use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found