[PR #575] [MERGED] fix(core): skip stdout writes in testing mode for writeOut functions #629

Closed
opened 2026-03-02 23:47:25 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/575
Author: @remorses
Created: 1/23/2026
Status: Merged
Merged: 1/23/2026
Merged by: @kommander

Base: mainHead: fix-test-renderer-stdout


📝 Commits (1)

  • a43bdee fix(core): skip stdout writes in testing mode for writeOut functions

📊 Changes

2 files changed (+5 additions, -2 deletions)

View changed files

📝 packages/core/src/renderer.ts (+2 -2)
📝 packages/core/src/zig/renderer.zig (+3 -0)

📄 Description

Without this change, the TUI was being rendered to the terminal when using the test renderer, polluting test output.

  • Add early return in writeOut() and writeOutMultiple() when self.testing is true
  • Use passed dimensions as fallback for terminalWidth/terminalHeight in non-TTY environments

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/575 **Author:** [@remorses](https://github.com/remorses) **Created:** 1/23/2026 **Status:** ✅ Merged **Merged:** 1/23/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix-test-renderer-stdout` --- ### 📝 Commits (1) - [`a43bdee`](https://github.com/anomalyco/opentui/commit/a43bdee448cb899d015cc238b2ea157ee8c0148c) fix(core): skip stdout writes in testing mode for writeOut functions ### 📊 Changes **2 files changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderer.ts` (+2 -2) 📝 `packages/core/src/zig/renderer.zig` (+3 -0) </details> ### 📄 Description Without this change, the TUI was being rendered to the terminal when using the test renderer, polluting test output. - Add early return in `writeOut()` and `writeOutMultiple()` when `self.testing` is true - Use passed dimensions as fallback for `terminalWidth`/`terminalHeight` in non-TTY environments --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:25 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#629
No description provided.