[PR #628] fix(core): correct colors in Apple Terminal and add 256-color fallback #1449

Open
opened 2026-03-14 09:37:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/628
Author: @Harry-zklcdc
Created: 2/4/2026
Status: 🔄 Open

Base: mainHead: main


📝 Commits (3)

  • bcae581 fix(terminal): disable truecolor and explicit width query for Apple Terminal
  • cadf881 feat(renderer): add 256-color fallback for non-truecolor terminals
  • 79eb5f3 fix(renderer): adjust rgbToAnsi256 function to handle edge case for red component #628

📊 Changes

3 files changed (+71 additions, -21 deletions)

View changed files

📝 packages/core/src/zig/ansi.zig (+8 -0)
📝 packages/core/src/zig/renderer.zig (+29 -3)
📝 packages/core/src/zig/terminal.zig (+34 -18)

📄 Description

Summary

  • Disable truecolor and explicit width probing for Apple Terminal to avoid incorrect color output.
  • Add 256-color fallback rendering when truecolor is not supported.
  • Route renderer color output through capability-aware selection (24-bit vs 256).

Snapshot

Before

image image

After

image image

🔄 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/628 **Author:** [@Harry-zklcdc](https://github.com/Harry-zklcdc) **Created:** 2/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`bcae581`](https://github.com/anomalyco/opentui/commit/bcae5815a93c030aa7987fecb621154c35a97975) fix(terminal): disable truecolor and explicit width query for Apple Terminal - [`cadf881`](https://github.com/anomalyco/opentui/commit/cadf881de6cad5df01af678f50d97ff02aea7c77) feat(renderer): add 256-color fallback for non-truecolor terminals - [`79eb5f3`](https://github.com/anomalyco/opentui/commit/79eb5f3f55acd88c57fd57cac8377a54fe67205b) fix(renderer): adjust rgbToAnsi256 function to handle edge case for red component #628 ### 📊 Changes **3 files changed** (+71 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/zig/ansi.zig` (+8 -0) 📝 `packages/core/src/zig/renderer.zig` (+29 -3) 📝 `packages/core/src/zig/terminal.zig` (+34 -18) </details> ### 📄 Description ## Summary - Disable truecolor and explicit width probing for Apple Terminal to avoid incorrect color output. - Add 256-color fallback rendering when truecolor is not supported. - Route renderer color output through capability-aware selection (24-bit vs 256). ## Snapshot ### Before <img width="1316" height="994" alt="image" src="https://github.com/user-attachments/assets/2a6f0abb-aef0-44ff-8f68-23d0a1ef38ca" /> <img width="1076" height="742" alt="image" src="https://github.com/user-attachments/assets/8bab30c1-af0e-4365-a6cf-78e9b66e1f90" /> ### After <img width="1544" height="926" alt="image" src="https://github.com/user-attachments/assets/9eefbe6a-22b6-4444-988e-f1da7a1bc228" /> <img width="1544" height="926" alt="image" src="https://github.com/user-attachments/assets/40be6aa0-5b6e-4144-b4fa-2b59ec67d95d" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1449
No description provided.