Skip to content

Newline-terminate interactive prompts so they are actually displayed#1230

Open
ramonsmits wants to merge 1 commit into
mainfrom
announce-awaiting-input
Open

Newline-terminate interactive prompts so they are actually displayed#1230
ramonsmits wants to merge 1 commit into
mainfrom
announce-awaiting-input

Conversation

@ramonsmits

Copy link
Copy Markdown
Member

Prompts were written with Console.Write, i.e. without a trailing newline. Console.Out auto-flushes, so the bytes do leave the process — but a trailing partial line is not rendered by line-oriented consumers of stdout (PowerShell, CI logs). The prompt is therefore invisible while the tool blocks on the subsequent Console.ReadLine()/ReadKey(), and the tool appears to hang forever with no output and nothing in the event log.

Reported by a customer whose run sat "hung" for three days; it was in fact waiting at an "Enter customer name: " prompt they could never see.

Terminate the prompts with a newline instead. Affects the customer name prompt, the Y/N confirmation, and the HTTP basic-auth username/password prompts.

Prompts were written with Console.Write, i.e. without a trailing newline.
Console.Out auto-flushes, so the bytes do leave the process — but a trailing
partial line is not rendered by line-oriented consumers of stdout (PowerShell,
CI logs). The prompt is therefore invisible while the tool blocks on the
subsequent Console.ReadLine()/ReadKey(), and the tool appears to hang forever
with no output and nothing in the event log.

Reported by a customer whose run sat "hung" for three days; it was in fact
waiting at an "Enter customer name: " prompt they could never see.

Terminate the prompts with a newline instead. Affects the customer name prompt,
the Y/N confirmation, and the HTTP basic-auth username/password prompts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant