mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 04:55:58 +03:00
[GH-ISSUE #671] createCliRenderer should pass process.env to Zig opts.env_map #179
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#179
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JackCA on GitHub (Feb 11, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/671
Full disclosure, I have no experience with Zig and this issue is written with LLM assistance:
checkEnvironmentOverridescan't read environment variables when running as a Bun FFI shared library on Linux.std.process.getEnvMap()fails and thecatch returnsilently exits the function — no env-based detection runsat all.
process.env in JS has the correct values (COLORTERM=truecolor, TERM_PROGRAM=iTerm.app, etc.), but the Zig side
sees none of them. Initial capabilities report rgb=false, hyperlinks=false, empty terminal name.
The opts.env_map injection mechanism from #623 would fix this if the JS binding wired process.env through it.
Currently createRenderer only passes testing and remote — no env map.
Repro: Run any OpenTUI app via Bun on Linux where libopentui.so is loaded via FFI (ldd libopentui.so → statically
linked). Set COLORTERM=truecolor and observe that rgb stays false.
Impact: COLORTERM, TERM, TERM_PROGRAM, TMUX, and all OPENTUI_FORCE_* overrides are invisible to the Zig layer.
@kommander commented on GitHub (Feb 11, 2026):
Thanks for the disclosure.
Zig should see the same env as the bun process, when it succeeds, so there is no need to pass through the env from the bun/js process.
@simonklee we probably should log the error instead of silently failing, with
logger.zigto make it visible in the console, so we can see why it fails.@simonklee commented on GitHub (Feb 11, 2026):
Agree
@JackCA commented on GitHub (Feb 12, 2026):
FWIW, the original driver for this was to debug why hyperlinks weren't being enabled in a linux-based docker container run inside of iTerm. Just wanted to share that context in case it is relevant.
@simonklee commented on GitHub (Feb 24, 2026):
Fixed by
github.com/anomalyco/opentui@ba8822eec7