You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenTUI appears to not be respecting setting TMPDIR when starting up, leading to failure to initialize OpenTUI library #4605
$ TMPDIR=~/tmp2 opencode --print-logs --log-level DEBUG
INFO 2025-11-19T15:49:09 +222ms service=default version=1.0.78 args=["--print-logs","--log-level","DEBUG"] opencode
^[\ERROR 2025-11-19T15:49:10 +375ms service=acp-command promise={} reason=Failed to initialize OpenTUI render library: Failed to open library "/tmp/.d97d732dff7fbff3-00000001.so": /tmp/.d97d732dff7fbff3-00000001.so: failed to map segment from shared object Unhandled rejection
ERROR 2025-11-19T15:49:10 +0ms service=default e=Failed to initialize OpenTUI render library: Failed to open library "/tmp/.d97d732dff7fbff3-00000001.so": /tmp/.d97d732dff7fbff3-00000001.so: failed to map segment from shared object rejection
ERROR 2025-11-19T15:49:10 +0ms service=default Error: Failed to initialize OpenTUI render library: Failed to open library "/tmp/.d97d732dff7fbff3-00000001.so": /tmp/.d97d732dff7fbff3-00000001.so: failed to map segment from shared object
This appears to be related to a longer standing bug that was closed recently #3765.
For me, all versions later than 1.0.55 fail. This also appears to affect Windows and other OS's.
Many secure environments mount /tmp with noexec as a standard security practice to prevent privilege escalation attacks. This is recommended by various security frameworks including CIS benchmarks and NIST guidelines. The application should not assume /tmp will have executable permissions.
I am not sure that is an opentui issue, that's the opencode executable? Opentui itself does not execute anything and does not deal with the tmpdir, unless the app tells it to, it uses XDG_CONFIG_HOME and XDG_DATA_HOME to download additional tree-sitter parsers and queries, that's about it. @thdxr@rekram1-node
Activity
kommander commentedon Nov 22, 2025
I am not sure that is an opentui issue, that's the opencode executable? Opentui itself does not execute anything and does not deal with the tmpdir, unless the app tells it to, it uses XDG_CONFIG_HOME and XDG_DATA_HOME to download additional tree-sitter parsers and queries, that's about it. @thdxr @rekram1-node
rwese commentedon Nov 28, 2025
It took me some digging into Bun to find this, but BUN_TMPDIR is what we must define:
$ BUN_TMPDIR=~/.tmp opencode --print-logsrwese commentedon Nov 28, 2025
I could add a 'KnownIssues' Pointer to the documentation, if needed let me know i can provide the PR.
kommander commentedon Nov 28, 2025
I think I misread the original issue earlier, that might be a bun issue if it unpacks native libs for ffi bindings into the wrong dir.
camAtGitHub commentedon Nov 30, 2025
We also have /tmp set to noexec.
$ BUN_TMPDIR=~/.tmp opencode /my/repo/dirwas the secret sauce I needed.azinsharaf commentedon Mar 17, 2026
i can confirm this workaround fixed the issue on Win 10. Is there any fix planned for it?