Skip to content

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

Open
@zacuke

Description

@zacuke

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions