-
Notifications
You must be signed in to change notification settings - Fork 645
Please support "console" Property in launch.json #843
Comments
I think the relevant code in the python vs code extension is here: |
Ditto to item 1 |
Any word on this? I'm just running into this now. |
Any updates? @ramya-rao-a Here due to 219 |
@varun1729 No updates yet. PRs are welcome if anyone knows how to make this work using the delve apis. |
I think this might be a limitation of delve as the go extensions for Atom seem to have the same issue. |
@ramya-rao-a The corresponding issue in the delve repository (https://github.com/derekparker/delve/issues/65) has been closed since May, but after I've updated my delve to latest master, using it with vscode debug results in error messages instead of no response:
Does this mean this feature can finally get supported? BTW the usage instructions is here: https://github.com/derekparker/delve/issues/1274#issuecomment-406969034. I've tried on a terminal and it works! You have to fiddle between two terminals, but in vscode-go this can be hidden behind the interface right? |
@lirao That error message is from I've not looked into supporting the terminal when debugging yet. When I do, I'll get back here. Meanwhile, others are most welcome to check out the missing pieces and investigate the missing gaps. |
I'm not really looking into VSCode supporting the terminal (if I want to use the terminal I could just use the terminal) I'm interested in just debugging go code with interactive stdin input. A few months ago this wasn't even possible even on delve natively, so vscode can't possibly support this. But now that this mechanism is there in delve itself, when will vscode make use of it? |
@lirao I believe you have misunderstood my statement. I did not mean just "using the terminal". I meant using the terminal to run delve such that it can take in stdin. See https://code.visualstudio.com/updates/v1_5#_additions-to-the-debug-protocol
Have you given this a try in the terminal? I followed the instructions in https://github.com/derekparker/delve/issues/1274#issuecomment-406969034. In the second terminal, delve starts in the "client" mode and so accepts only delve commands not stdin. Am I missing something? |
It's how they implemented it (that's why it's a bit wonky). One I'm not familiar with the code base, and so I'm not certain if this is something that should be implemented in the plugin as |
I am pretty new to Go and just ran in this problem while trying to run some examples from the tcell library.
Documention about vscode-go remote debugger. |
@abc1236762 Delve currently does not support reading from stdin so I don't know how valuable it will be to add support for "console" property in launch.json. I think the remote solution that @francoisgergaud has is the best here. |
The remote works but is pretty bad UX at best -- Things like stop on the "local" side doesn't stop the remote dlv instance, and having to go though multiple steps to start a debug session (in my case starting a build and only THEN starting a debug session in vscode) Could adding the console option and automatically working this out in the background be an option? I'm not too sure of the internals, but something as simple as allowing console, but then not allowing manual input via the debug console? that input could go to the headless dlv instance instead |
For me, this is not about delve reading from stdin. It's about debugging interactive applications. My current workaround is starting my binary in the terminal myself and then connecting the debugger using the standard "Attach to Process". This works as you'd expect; my application still responds to user input and the deubgger features in vscode work as well. I don't understand why a console argument couldn't work for Go like it does for other languages. All it seemingly does is start the binary in the terminal instead of the debug console? |
Same here, my software has an interactive command line. As a workaround I put together some tasks and such to make it only a two step process to start delve in headless mode (to give application stdin access) and then I can start regular debugging in the normal way: {
"label": "startgggbdebug",
"type": "shell",
"command": "dlv debug --headless --listen :4247 --api-version=2 ${workspaceFolder}/cmd/goGoGameBot.go",
"group": {
"kind": "build",
"isDefault": true
},
}, which I can start with and debug is configured to run a {
"label": "killgggbdebug",
"type": "shell",
"command": "pkill -f --exact \"dlv debug --headless --listen :4247 --api-version=2 ${workspaceFolder}/cmd/goGoGameBot.go\"",
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false
}
} This is still a hack around something that the plugin's competitor (goland) has done (I believe by doing essentially the same as the above, but transparently to the user) This seems like something that could be quite easily added to the plugin itself without requiring users to go to this extra effort. EDIT: As an update to the above, I must note that you can not add the start task as a pre-launch task, as vscode waits for an exit from pre-launch tasks before starting the main. |
Hello all, We are in the midst of a repo move, see We are moving section in our readme for more details. Closing this issue in favor of golang/vscode-go#124. Please subscribe to it for further updates and upvote it as well. Unfortunately, we could not transfer the issue across Github orgs, therefore could not move the upvotes this feature request has acquired over time. Thanks for all the support & Happy Coding! |
Please support
"console"
Property in launch.json, which have"none"
,"integratedTerminal"
,"externalTerminal"
three Value like python's, and I can debug my go project at outside console and also support standard input.The text was updated successfully, but these errors were encountered: