Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command is truncated when launching debugging in the integratedTerminal on Insiders #107969

Closed
nodorious opened this issue Oct 2, 2020 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders terminal Integrated terminal issues verified Verification succeeded

Comments

@nodorious
Copy link

Version: 1.50.0-insider (system setup)
Commit: 2289738
Date: 2020-10-01T05:33:55.357Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

i am having a problem using the insiders edition when debugging node locally. this problem does not occur in the released version 1.49.2. i am syncing settings between my ms code versions, and i am using the same launch.json file in both cases.

i have two local debugging scenarios... with "runtimeExecutable": "nodemon" and without.

in the insiders edition, when i try debug locally without nodemon ms code does launch node successfully and i can debug, but when i stop the debugger node exits with code 1.

in the insiders edition when i try to debug locally with nodemon ms code fails to launch node successfully.

launch command from v1.49.2 of ms code (which works):

PS C:\work\antibsmachine>  cd 'c:\work\antibsmachine'; ${env:NODE_OPTIONS}='--require "c:/Program Files/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" --inspect-publish-uid=http'; ${env:VSCODE_INSPECTOR_OPTIONS}='{"inspectorIpc":"\\\\.\\pipe\\node-cdp.1924-2.sock","deferredMode":false,"waitForDebugger":"","execPath":"C:\\Program Files\\nodejs\\node.exe","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"C:\\Users\\jotha\\AppData\\Local\\Temp\\node-debug-callback-a6c5abf2e86c1fb1"}'; & 'C:\Users\jotha\AppData\Roaming\npm\nodemon.cmd' '.\start.js' 

launch command from insiders edition (which fails):

PS C:\work\antibsmachine> /Microsoft VS Code Insiders/resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" --inspect-publish-uid=http'; ${env:VSCODE_INSPECTOR_OPTIONS}='{"inspectorIpc":"\\\\.\\pipe\\node-cdp.31152-5.sock","deferredMode":false,"waitForDebugger":"","execPath":"C:\\Program Files\\nodejs\\node.exe","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"C:\\Users\\jotha\\AppData\\Local\\Temp\\node-debug-callback-19b3ff13082ce317"}'; & 'C:\Users\jotha\AppData\Roaming\npm\nodemon.cmd' '.\start.js'

the second one is missing:
cd 'c:\work\antibsmachine'; ${env:NODE_OPTIONS}='--require "c:/Program Files

relevant part of my launch.json

  {
      "name": "local debug",
      "type": "node",
      "request": "launch",
      "program": "${workspaceFolder}\\start.js",
      "skipFiles": [
        "${workspaceFolder}/node_modules/**/*.js",
        "<node_internals>/**/*.js"
      ]
    },

  {
      "name": "local debug w/nodemon",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "nodemon",
      "program": "${workspaceFolder}\\start.js",
      "restart": true,
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "skipFiles": [
        "${workspaceFolder}/node_modules/**/*.js",
        "<node_internals>/**/*.js"
      ]
    },

i'm happy to provide more details if you need please just let me know. thank you...

Originally posted by @nodorious in #104195 (comment)

@vscodebot
Copy link

vscodebot bot commented Oct 2, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@connor4312
Copy link
Member

Thanks! Cc @weinand / @alexr00. Looks like command to the terminal is getting truncated.

@nodorious which shell are you using in VS Code? Standard cmd.exe, powershell, something else?

@nodorious
Copy link
Author

nodorious commented Oct 2, 2020

interesting...

the above was with powershell (apparently the default config, i don't think i selected it intentionally).

i just changed code (insiders) to use cmd and the problem above does not occur :)

when i launch the debugger without nodemon i do not see anything at all in the code terminal window, but the process does start and i can debug it.

when i start the debugger with nodemon i do see the start command in the code terminal window and the process does start and i can debug it.

@connor4312
Copy link
Member

connor4312 commented Oct 2, 2020

i do not see anything at all in the code terminal window, but the process does start and i can debug it.

You don't have "console": "integratedTerminal", in your 'without nodemon' scenario, and by default we only capture console logs, so if you manually write to process.stdout or process.stderr that isn't captured, unless you do one of two things:

  • Run in a real terminal, like you are with nodemon
  • Set outputCapture: "std" to capture stdio instead of using the console api over the debug protocol

Thanks for the info, reassigning

@connor4312 connor4312 assigned alexr00 and unassigned connor4312 Oct 2, 2020
@connor4312 connor4312 changed the title fails to launch node when debugging locally Command is truncated when launching debugging in the integratedTerminal on Insiders Oct 2, 2020
@connor4312 connor4312 added the terminal Integrated terminal issues label Oct 2, 2020
@alexr00
Copy link
Member

alexr00 commented Oct 5, 2020

The data to write to the terminal gets chunked, and it looks like we're losing the first chunk.

@alexr00 alexr00 added the bug Issue identified by VS Code Team member as probable bug label Oct 5, 2020
@alexr00
Copy link
Member

alexr00 commented Oct 5, 2020

Bisect to find that it started with 362b7f3

@alexr00
Copy link
Member

alexr00 commented Oct 5, 2020

@isidorn I'm not sure how 362b7f3 is causing this. Do you have any ideas?

@alexr00 alexr00 added the debug Debug viewlet, configurations, breakpoints, adapter issues label Oct 5, 2020
@alexr00 alexr00 added this to the September 2020 milestone Oct 5, 2020
@alexr00 alexr00 added the candidate Issue identified as probable candidate for fixing in the next release label Oct 5, 2020
@connor4312
Copy link
Member

connor4312 commented Oct 5, 2020

Isi and Andre are both on vacation this week. I suggest reverting the change for this month if it's causing issues; seems like that's been a bug that's existed for years.

@alexr00
Copy link
Member

alexr00 commented Oct 6, 2020

Verified by Connor when doing PR review.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders terminal Integrated terminal issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants
@isidorn @connor4312 @nodorious @alexr00 and others