-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Labels
Area-InteractionInteracting with the vintage console window (as opposed to driving via API or hooks)Interacting with the vintage console window (as opposed to driving via API or hooks)In-PRThis issue has a related PRThis issue has a related PRIssue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsPriority-2A description (P2)A description (P2)Product-ConhostFor issues in the Console codebaseFor issues in the Console codebase
Milestone
Description
To do this, we need to do #796 first.
This was a customer feedback bug MSFT:16934245. I didn't feel confident touching it because Resize with Reflow is sorta sketchy and was done before we really hit our stride on this project.
Here's the original Repro Steps:
Repro:
Create a new C# console application.
Use
Console.WriteLine()to ask the user a question.Then use the
ReadFromConsole_YesNo()method below to ask for a yes or no answer.Before pressing any key, maximize the console window that gets launched by VS.
ER: Insertion point remains indented by 4 spaces
AR: Insertion point jumps back to start of line
Once we have some actual tests around this, we might be able to dial in the resize with reflow algorithm to handle this better.
/// <summary> /// Continuously reads lines of input from the console until a yes or no answer is received. /// Returns true if the read answer was "yes". Otherwise, false is returned for "no". /// </summary> static bool ReadFromConsole_YesNo() { // Keep reading answers from the console until we get a "yes" or "no". while (true) { Console.Write(" "); // Indent input answers for readability Console.Out.Flush(); string line = Console.ReadLine().Trim().ToLower(); // Get next answer // Check if it's a "yes" or "no". if (line.Equals("yes")) {return true;} else if (line.Equals("y")) {return true;} else if (line.Equals("no")) {return false;} else if (line.Equals("n")) {return false;} } }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-InteractionInteracting with the vintage console window (as opposed to driving via API or hooks)Interacting with the vintage console window (as opposed to driving via API or hooks)In-PRThis issue has a related PRThis issue has a related PRIssue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsPriority-2A description (P2)A description (P2)Product-ConhostFor issues in the Console codebaseFor issues in the Console codebase