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

serverReadyAction doesn't work with integratedTerminal #70855

Closed
kf6kjg opened this issue Mar 20, 2019 · 3 comments
Closed

serverReadyAction doesn't work with integratedTerminal #70855

kf6kjg opened this issue Mar 20, 2019 · 3 comments
Assignees
Labels
*as-designed Described behavior is as designed debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@kf6kjg
Copy link

kf6kjg commented Mar 20, 2019

  • VSCode Version: 1.32.3
  • OS Version: Win 10.0.17134

Steps to Reproduce:

{
  "version": "0.2.0",
  "configurations": [
		{
			"type": "node",
			"request": "launch",
			"name": "Launch and debug",
			"runtimeExecutable": "nodemon",
			"restart": true,
			"console": "integratedTerminal",
			"internalConsoleOptions": "neverOpen",
			"serverReadyAction": {
				"pattern": "Server started at (https?://[^:]+:[0-9]+)",
				"urlFormat": "%s",
				"action": "debugWithChrome",
				"webRoot": "${workspaceFolder}"
			}
		}
  ]
}

The application launched and shows ready:

Microsoft Windows [Version 10.0.17134.648]
(c) 2018 Microsoft Corporation. All rights reserved.

REDACTED>cd REDACTED && REDACTED\AppData\Roaming\npm\nodemon.cmd --inspect-brk=10105
[nodemon] 1.18.9
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node --inspect-brk=10105 server.js`
Debugger listening on ws://127.0.0.1:10105/e7f8422e-aee0-4e5d-9560-8b0c8ac585bb
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Server started at http://localhost:8080

However no Chrome debug instance shows.

Alternate configs tested:

  1. integratedTerminal with openExternally: no browser window opened.
  2. internalConsole with debugWithChrome: Chrome debug window launches pointed at the URL.
  3. internalConsole with openExternally: Current browser's active window gets a new tab pointed at the URL.

Looks like the problem is that output to the integrated terminal is not parsed.

@vscodebot
Copy link

vscodebot bot commented Mar 20, 2019

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

@kf6kjg
Copy link
Author

kf6kjg commented Mar 20, 2019

Looks like this was expected in #69311's definition now that I've found and read it. However the built-in template configuration for nodemon produces

{
	"type": "node",
	"request": "launch",
	"name": "nodemon",
	"runtimeExecutable": "nodemon",
	"program": "${workspaceFolder}/app.js",
	"restart": true,
	"console": "integratedTerminal",
	"internalConsoleOptions": "neverOpen"
},

which is where I got those settings. I suspect there's reasons for nodemon default settings to be this way, but I've not researched it.

@weinand
Copy link
Contributor

weinand commented Mar 20, 2019

The "serverReadyAction" is a "Preview" as clearly stated in the February release notes:

https://code.visualstudio.com/updates/v1_32#_preview-features

and one of the limitations is the issue you are seeing:

2019-03-20_21-05-36

In the latest Insiders of VS Code the "serverReadyAction" feature works in the integrated terminal.

The reason why the nodemon launch configuration makes use of the integrated terminal is explained here:

https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_restarting-debug-sessions-automatically-when-source-is-edited

@weinand weinand closed this as completed Mar 20, 2019
@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues *as-designed Described behavior is as designed labels Mar 20, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

2 participants