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

Ctrl+C not recognized in Debugging Console and csharp.debug.console is ignored #7882

Open
zacuke opened this issue Dec 17, 2024 · 0 comments

Comments

@zacuke
Copy link
Contributor

zacuke commented Dec 17, 2024

Steps to reproduce

  1. Create new web app with dotnet new blazor
  2. Create launch.json
{
    "version": "0.2.0",
    "configurations": [

        {
            "type": "dotnet",
            "request": "launch",
            "name": "Launch Edge against localhost",
            "projectPath":"${workspaceFolder}/myapp.csproj"
        }
    ]
}
  1. Create settings.json
{
   "csharp.debug.console": "externalTerminal"
}
  1. Debug the app, but an external terminal does not pop open.
  2. The message tells the user to press Ctrl+C but this doesn't work in debug console.
Microsoft.Hosting.Lifetime: Information: Now listening on: https://localhost:7059
Microsoft.Hosting.Lifetime: Information: Now listening on: http://localhost:5000
Microsoft.Hosting.Lifetime: Information: Application started. Press Ctrl+C to shut down.
Microsoft.Hosting.Lifetime: Information: Hosting environment: Development
Microsoft.Hosting.Lifetime: Information: Content root path: C:\src\myapp

Expected behavior

It's expected to be able to pop open a terminal with "csharp.debug.console": "externalTerminal"

Actual behavior

csharp.debug.console is ignored

Additional context

Traditional Visual Studio and base C# vscode extension allow opening external terminal, so it's a surprise behavior that this setting is silently ignored. All dotnet apps are technically console apps.

Workaround since the extension code matches on sdk string: microsoft/vscode-dotnettools#1473

The code changes to get this working are here #7878 and I note that browser auto-open continues to function.

This is basically a duplicate of this ticket #7165

I have a real world project where Ctrl+C is relevant because my console app uses the web sdk and launches additional processes, and I needed a way to debug Ctrl+C, SIGINT, X button, etc, in order to debug child process termination behavior.

Suggested change to documentation is to say the app's console in place of console projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant