Skip to content

Fix CLI crash in non-TTY environments (fixes #122)#123

Merged
DmitrySharabin merged 1 commit intomainfrom
fix/non-tty-crash
Mar 3, 2026
Merged

Fix CLI crash in non-TTY environments (fixes #122)#123
DmitrySharabin merged 1 commit intomainfrom
fix/non-tty-crash

Conversation

@DmitrySharabin
Copy link
Copy Markdown
Member

@DmitrySharabin DmitrySharabin commented Mar 3, 2026

Summary

  • Introduces an isInteractive flag (!options.ci && process.stdout.isTTY && process.stdin.isTTY) that gates the entire interactive experience
  • Unifies the former --ci path and the new non-TTY auto-detection into a single branch, eliminating the duplication
  • In non-interactive mode, live progress renders are suppressed and the final result tree is printed once before exiting with the correct code

Test plan

  • Run npx htest <suite> | cat — should print results and exit cleanly with correct exit code (no setRawMode crash)
  • Run with --ci flag — behavior unchanged
  • Run in a normal TTY — interactive mode still works as before

Guard interactive mode behind `isInteractive` flag
(`!options.ci && process.stdout.isTTY && process.stdin.isTTY`),
which also unifies the CI path and the non-TTY auto-detection into
a single branch. In non-interactive mode, live progress renders are
suppressed and the final result tree is printed once before exiting
with the correct code.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 3, 2026

Deploy Preview for h-test ready!

Name Link
🔨 Latest commit 0509a5e
🔍 Latest deploy log https://app.netlify.com/projects/h-test/deploys/69a6ba6026e5f60008ef89a9
😎 Deploy Preview https://deploy-preview-123--h-test.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DmitrySharabin DmitrySharabin requested a review from LeaVerou March 3, 2026 10:41
@DmitrySharabin DmitrySharabin merged commit b82d6e8 into main Mar 3, 2026
4 checks passed
@DmitrySharabin DmitrySharabin deleted the fix/non-tty-crash branch March 3, 2026 16:45
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.

2 participants