mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 04:55:58 +03:00
[GH-ISSUE #729] Environment variable lookup in zig library is broken #967
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#967
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 @simonklee on GitHub (Feb 22, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/729
OPENTUI_NO_GRAPHICS=1 works in native Zig tests, but is not seen in the Bun FFI shared-library runtime. The JS -> Bun FFI -> Zig shared-library path has footguns.
Problem:
In zig std/process.zig:
uses std.c.environ only when builtin.link_libc == true, otherwise std.os.environ.
In Bun FFI shared-lib mode, std.os.environ is effectively empty, so env lookups return missing. Our tests dont hit this path, but JS->FFI->Zig / opencode runtime does.
Also, in std/os.zig:
The situation seems to be improving with zig 0.16: https://codeberg.org/ziglang/zig/pulls/30644, but it doesn't solve the situation.
Explicitly passing env variables from host is a fairly straight forward way to solve this.