Merged
Conversation
Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
ipaqsa
reviewed
Mar 2, 2026
ipaqsa
requested changes
Mar 2, 2026
kneumoin
approved these changes
Mar 3, 2026
ipaqsa
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem
In non-interactive environments (for example inside a pod, CI job, or any run without a TTY),
AskYesNoWithTimeoutcould repeatedly print input error messages and create noisy output instead of gracefully falling back to a default decision.Root cause
The confirmation loop kept retrying after read failures from
stdin. In non-TTY scenarios this error is persistent, so the loop never recovered and continuously retried.Additionally, the previous channel usage could lead to fragile behavior around timeout vs. input delivery.
Solution
stdinread error, stop retrying, choose a default answer, and exit the goroutine.y/nvalidation).Syscalls / TTY detection
AskYesNoWithTimeoutusesgolang.org/x/term.IsTerminalto detect whether the session is interactive.This is the recommended cross-platform approach: it relies on OS-specific implementations under the hood (
ioctlon Unix-like systems andGetConsoleModeon Windows via build tags).No custom direct syscall logic was added in this change, so platform portability and builds remain safe.
Before fix
2026-02-27.12.27.10.mov
After fix