3

playing around with the newly released VSCode Editor/IDE. I wanted to try out debugging on a very basic Node.JS CLI application, which uses the "prompt" npm package:

prompt.start();
prompt.get(schema, function (err, result) { ...

When I set some breakpoints and start the app debugging, VSCode just steps over the prompt.get() and hangs in the debug process until I force to stop it, which ends in an error "OpenDebug process has terminated unexpectedly".

I expected VSCode to open up a shell that I can interact with.

My guess is that it's just not implemented the right way yet, but probably I just couldn't figure it out...

6
  • I couldn't get variables to work in debug mode. The app is in preview, I think it still needs some polish. Looks promising though. Commented Apr 30, 2015 at 3:51
  • Is it possible it took over a shell you had running in the background without noticing? I tried out that prompt code in VSCode on my computer and it silently took over a terminal window I had running in the background. If it hadn't been partly uncovered I wouldn't have noticed. Commented Apr 30, 2015 at 4:13
  • @LoganTegman thought about that too and doublechecked, but there was nothing in the single open terminal, neither in Tilda. I guess Dermot is right, it's in a very early preview stage. I think it's going to the right direction but needs a good bunch of work. Commented Apr 30, 2015 at 11:24
  • I believe this is currently a limitation of Visual Studio Code: Preview debug. @Dermot can you please give more details on variables not working in debug mode? Commented Apr 30, 2015 at 13:21
  • 2
    Visual Studio code 0.3.0 has fixed this. Commented Jun 2, 2015 at 22:26

1 Answer 1

6

On Linux Visual Studio Code does not yet open a terminal for the program to be debugged, so there is no way to interact with it through the command line. As a workaround you can launch the node program from a terminal in debug mode and attach to it from VSCode. I have created a bug on our side and will make sure it’s fixed with the next release.

Andre Weinand, Visual Studio Code

Sign up to request clarification or add additional context in comments.

2 Comments

Hi @andre-weinand I've been googling and trying to find more information but I don't seem to find any updated info on this. Is there a way to learn more about how to debug cli applications on VSCode? thanks!
The problem from above has been fixed some time ago. You can launch node.js programs into the 'Integrated Terminal' or an 'External Terminal'. Both support reading input from the terminal. See VS Code documentation: code.visualstudio.com/docs/editor/node-debugging#_node-console

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.