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.

@DavidBoike DavidBoike left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps instead we should use Environment.UserInteractive instead, and if it is not user interactive, throw unless the required options like --unattended and --customerName are provided.

Because the real problem is that the person trying to run it through a CI system does not know they are not running it with the right options to succeed that way, right?

I have to admit though I have no idea how the interactive login for Rabbit works if you're trying to use it in unattended mode.

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.

3 participants