fix(shell): guard TUI render against non-TTY Docker environments#118
Merged
skulidropek merged 3 commits intoProverCoderAI:mainfrom Mar 9, 2026
Merged
fix(shell): guard TUI render against non-TTY Docker environments#118skulidropek merged 3 commits intoProverCoderAI:mainfrom
skulidropek merged 3 commits intoProverCoderAI:mainfrom
Conversation
Ink's render() calls setRawMode(true) on mount. When docker-git runs without a pseudo-TTY (docker exec without -t, CI, piped stdin), this throws "Raw mode is not supported" and waitUntilExit() never resolves, causing an infinite hang. - Wrap render() in Effect.suspend and check process.stdin.isTTY and typeof process.stdin.setRawMode before calling render() - Fail immediately with a descriptive InputReadError guiding the user to attach a terminal (ssh or docker run -it) Invariant: ∀ env: ¬isTTY(env) → fail(InputReadError) ∧ ¬hang Closes ProverCoderAI#100 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Instead of failing with InputReadError, docker-git menu now runs listProjectStatus in non-interactive environments (Docker without -t, CI, piped stdin). Zero errors for the user. ∀ env: isTTY(env) → TUI, ¬isTTY(env) → listProjectStatus ∧ exit 0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace Effect.suspend (union of incompatible branches) with Effect.flatMap on a boolean so TypeScript unifies the two branch types: Effect<void, InputReadError, never> | Effect<void, never, R> → Effect<void, InputReadError, R>. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
runMenuдобавлен guard черезEffect.suspend— перед вызовомrender()проверяетсяprocess.stdin.isTTY && typeof process.stdin.setRawMode === "function"-t, CI, piped stdin) — возвращаетсяInputReadErrorс понятным сообщением вместо бесконечного зависанияmenu-shared.tsПричина бага: Ink вызывает
setRawMode(true)при монтировании компонента. Без псевдо-TTY это бросает"Raw mode is not supported", аwaitUntilExit()никогда не resolve-ится → вечный hang.Инвариант:
∀ env: ¬isTTY(env) → fail(InputReadError) ∧ ¬hangTest plan
docker-git menuв контейнере без-t→ должен получить ошибку"TUI requires a TTY. Attach a terminal: ssh into the container or use \docker run -it`."` вместо зависанияdocker-git menuчерез SSH в контейнер → TUI работает как преждеCloses #100
🤖 Generated with Claude Code