Type: Debugger
OS and Version:
Microsoft Windows [Version 10.0.17134.112]
VS Code Version:
Version 1.24.1
Commit 24f62626b222e9a8313213fb64b10d741a326288
Date 2018-06-13T17:51:32.889Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
C/C++ Extension Version:
Version 0.17.4
Other extensions you installed (and if the issue persists after disabling them):
None
A clear and concise description of what the bug is.
Trying to send ctrl-c to debug console but not triggering console interrupt handler in source code
Additional context
Tried adding logging to debugger but no events are being captured for this
Tried adding logging to debugger but no events are being captured for this
What did you try?
Can you please post your launch.json and which type of application you are debugging?
If you want to send Ctrl+c you probably need to use the terminal that appears and not the debuggerTerminal in VS Code since we aren't hooked up to that yet.
I am using libuv to trap signals, the debugger spawns a separate console but it is not trapping the key signals. I expect it to handle ctrl-c and ctrl-break signals when pressed. I have created a repo with a demo of bug.
Repo is here https://github.com/simon-p-r/vscode-debugger-signal
There's probably an issue relating to this in just about every Windows terminal project. They've been impossible to make work consistently, and I think most people have given up on them until the PTY API is made stable. The only thing that consistently works is finding the hidden console window and sending it WM_KEYDOWN/WM_KEYUP messages.
@simon-p-r I have your repo but I can't figure out how to build. I installed your tool set items below and then ran vcpkg install libuv, I set the libuv Library path environment variable. and then tried both cmake and cmake-js's builds.
Sorry that was not clear, you need to run build.js script with node. It needs to find version of libuv installed by vcpkg
I've just noticed the same trying to debug a golang issue where the application would hang on signal. Doesn't seem possible to Ctrl-C in the debug console. This is on OSX.
Bump!
First off, shoutout to the VS Code dev team for making such a badass piece of software! It just keeps getting better and the Go support is so lovely. Thanks so much and and sending y'all good vibes! <3
Anyway, yes, I get the complexity around Ctrl+C mysteriously not arriving to a given debug process. However, maybe it's easy/doable to have SIGINT or SIGTERM make it when coming from the OS? Justing being able to execute kill -s SIGTERM 12345 for a daemon running under the VS Code debugger would be awesome. Otherwise, to simulate a SIGINT (ctrl+c), we have to have painful hack in place (and make sure that code never gets committed, etc). As is, sending a SIGTERM, SIGINT, and SIGHUP never show up (via package signal.Notifiy() handler) when the process is running in the VS Code debugger.
Heeeelp! Kindly get this to this lil but helpful thing!
@drew-512 this is the C++ extension. If you are asking for VS Code to support it for Go, you will need to ask either VS Code or the Go extension you are using.
For C++ this is currently on the list of items to tackle.
Bump. Still happens in 1.44.1 on Windows 10 in nodejs environment
Tried this in 1.47.2 on Ubuntu in python environment, and it's still happening.
Hey @pieandcakes, this issue might need further attention.
@simon-p-r, you can help us out by closing this issue if the problem no longer exists, or adding more information.
This issue has been closed automatically because it needs more information and has not had recent activity.
I think this issue should not have been closed, what information is missing?
I believe that vs code or gdb catch the Ctrl+C and instantly kill the application without sending a signal or giving it time to exit gracefully. That is very annoying if you are debugging an app that needs a signal to gracefully shutdown and clean up.
Thanks for letting us know.
Most helpful comment
I've just noticed the same trying to debug a golang issue where the application would hang on signal. Doesn't seem possible to Ctrl-C in the debug console. This is on OSX.