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

[SUGGESTION] Change debug default from integrated console for console apps or better message #585

Open
timheuer opened this issue Oct 6, 2023 · 3 comments
Labels
area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire enhancement New feature or request triaged The issue has been triaged
Milestone

Comments

@timheuer
Copy link
Member

timheuer commented Oct 6, 2023

Describe the Issue

Code:

Console.WriteLine("Start");
var x = Console.ReadLine();
Console.WriteLine("Mid");
Console.WriteLine(x.Reverse());
Console.WriteLine("End");

When you F5/debug the integrated console runs, you can enter input, but the subsequent WriteLine for mid, reverse, end are not executed.

Steps To Reproduce

Create a console app
Code:

Console.WriteLine("Start");
var x = Console.ReadLine();
Console.WriteLine("Mid");
Console.WriteLine(x.Reverse());
Console.WriteLine("End");

Expected Behavior

Last three lines are output

Environment Information

No response

@timheuer timheuer added the bug Something isn't working label Oct 6, 2023
@microsoft-issue-labeler microsoft-issue-labeler bot added the area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire label Oct 6, 2023
@AgentMC
Copy link

AgentMC commented Oct 6, 2023

Thanks Tim for creating the bug :)
Workaround: Preferences > Debug:Console - set to anything other than "internal console". Focus is not properly switched but at least this works.

For repo maintainers: if this is by design (which is... surprising to say the least for VSCode as a teaching instrument)
image
— then there totally should be some experience warning the user that the input cannot be read.
Or well, maybe default should be internal terminal or external one?

@timheuer timheuer changed the title [BUG] Debug a console app isn't completing execution when ReadLine [SUGGESTION] Change debug default from integrated console for console apps or better message Oct 6, 2023
@timheuer timheuer added enhancement New feature or request and removed bug Something isn't working labels Oct 6, 2023
@timheuer
Copy link
Member Author

timheuer commented Oct 6, 2023

@AgentMC nice, sorry I didn't even know that (looks at mirror in embarassment) -- I changed the title per your question on changing default and/or better message on output if possible.

@WardenGnaw WardenGnaw added the triaged The issue has been triaged label Oct 18, 2023
@gregg-miskelly
Copy link
Member

This is mostly a duplicate of dotnet/vscode-csharp#5704, but I will leave this open for future consideration after dotnet/vscode-csharp#5704 is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire enhancement New feature or request triaged The issue has been triaged
Projects
None yet
Development

No branches or pull requests

4 participants