2

I have a typescript remote platform project, using visual studio code (V1.28.2) as IDE. Node.js is started on platform, using the command node --inspect=0.0.0.0:9229 --inspect-brk=0.0.0.0:9229 ... there.

In visual studio code the launch.json file defines an attach request:

{
    "version": "0.2.0",
    "configurations": [
         {
            "type": "node",
            "request": "attach",
            "name": "Launch on RPI",
            "sourceMaps": true,
            "smartStep": true,
            "stopOnEntry": false,
            "port": 9229,
            "address": "192.168.1.2",
            "restart": false,
            "localRoot": "${workspaceRoot}/",
            "remoteRoot": "/home/pi/remoteproject/"
       }
    ]
}

```

Everything is working fine (starting, debugging, ...). But there is one issue I cannot understand.

A call of console.log('Hello'); is written in the Debug console window of code.
A call of process.stdout.write('Hello\n'); is suppressed there.

If the program is started inside a shell on the remote platform, both statements are printed out.

What is the reason for this different behavior? How I can redirect stdout to to visual studio code Debug console (or terminal) window?

Manfred Steiner
  • 1,215
  • 2
  • 13
  • 27

1 Answers1

1

It's just how they've setup the integrated terminal, you can enable stdout by adding the "outputCapture": "std" flag to the configuration

MoreThanTom
  • 526
  • 2
  • 9
  • The attribute `outputCapture` is working for `"request":"launch"` configuration. It is not allowed (and not working) for `"request":"attach"` configuration (see question), – Manfred Steiner Oct 24 '18 at 03:57