dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.87k stars 676 forks source link

Debugger fails when using "externalTerminal" option on Linux. #2636

Open jchand99 opened 6 years ago

jchand99 commented 6 years ago

Environment data

dotnet --info output:

 Version:   2.1.403
 Commit:    04e15494b6

Runtime Environment:
 OS Name:     arch
 OS Version:
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /opt/dotnet/sdk/2.1.403/

Host (useful for support):
  Version: 2.1.5
  Commit:  290303f510

.NET Core SDKs installed:
  2.1.403 [/opt/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.5 [/opt/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.5 [/opt/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.5 [/opt/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

VS Code version: 1.28.2 C# Extension version: 1.17.0

Steps to reproduce

Create new Hello World console application using command:

dotnet new console

then change the console option to "externalTerminal" and build/Run the application.

Expected behavior

Print "Hello World!" in an external terminal.

Actual behavior

External terminal shows up, program looks like it hangs while debugging and nothing prints. Exit out of the external terminal and VSCode prompts you with an alert box saying open launch.json.

jchand99 commented 6 years ago

Update 1.17.0 Fixed the integrated terminal failure where it was throwing a free() pointer error. But external terminal still doesn't work correctly.

gregg-miskelly commented 6 years ago

@jchand99 A few questions --

  1. Does it work correctly (in 1.17) for you with "console": "integratedTerminal"?
  2. With externalTerminal: Can you hit a breakpoint at the start of main? If you look at a process listing, can you tell (based on parent/child relationships) which processes are active in the spawned external terminal?
jchand99 commented 6 years ago

1) Yes, "console": "integratedTerminal" works the output is this:

 /home/kas/.vscode/extensions/ms-vscode.csharp-1.17.0/.debugger/vsdbg --interpreter=vscode --connection=/tmp/CoreFxPipe_vsdbg-ui-0489572a8080411aae0fc473fc74f2a4
Hello World!

2) It won't hit a breakpoint anywhere in a standard HelloWorld console application with "console": "externalTerminal" set.