Skip to content

Conversation

@afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Nov 30, 2025

Closes #4410

Also makes sure that shell checks the --tty flag

Could probably use some tests, this is code only

The current UI library will crash, if trying to read
input from something that is not a terminal (a TTY).

Signed-off-by: Anders F Björklund <[email protected]>
// InputIsTTY returns true if reader is coming from stdin, and stdin is a terminal device,
// not a regular file, stream, or pipe etc.
func InputIsTTY(reader io.Reader) bool {
// This setting is needed so we can write integration tests for the TTY input.
Copy link
Member

Choose a reason for hiding this comment

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

The test seems missing?

@AkihiroSuda AkihiroSuda added this to the v2.1.0 (?) milestone Dec 1, 2025
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.

signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10fddebb6 (AlecAivazis/survey/v2/terminal.(*RuneReader).ReadLineWithDefault)

2 participants