Skip to content

TUI crashes with STATUS_ACCESS_VIOLATION (0xC0000005) during terminal capability negotiation on Windows on ARM (Snapdragon X Elite) #41099

Closed as not planned

Description

@zudanis

Description

Environment

  • Device: Windows 11 on ARM, Snapdragon(R) X Elite - X1E78100 (Qualcomm Oryon)
  • [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture → Arm64
  • Node.js (via Volta): native ARM64 build, process.arch → arm64
  • opencode binary used: opencode-windows-x64 (native opencode-windows-arm64 build crashes separately/differently, likely due to the known TinyCC/bun:ffi JIT issue on ARM64 — the x64 build runs fine standalone under Windows' x64 emulation for --version / opencode run, but not for the TUI, see below)

Versions tested (both crash identically)

Terminals tested (all crash identically)

  • Antigravity IDE integrated terminal
  • Classic PowerShell console host (conhost)
  • Genuine Windows Terminal app, multiple profiles: Windows PowerShell, Developer Command Prompt for VS 2022, Developer PowerShell for VS 2022

Other things ruled out

Steps to reproduce

  1. On a Windows-on-ARM machine, install opencode (npm install -g opencode-ai), running under opencode-windows-x64 (x64 build, since the native ARM64 build fails to start at all).
  2. Run opencode (bare, no args) from any terminal.
  3. It silently returns to the shell prompt after ~1-2 seconds. No visible error text. Leftover raw escape sequence fragments (e.g. ^[[O^[[I, stray [) are sometimes left printed at the next prompt, consistent with the process dying before it could restore terminal modes (it had enabled focus-event reporting / alternate screen before crashing).

Actual behavior
echo $LASTEXITCODE after the crash: -1073741819 (0xC0000005 / STATUS_ACCESS_VIOLATION).

Captured via opencode --print-logs --log-level DEBUG > log.txt 2>&1, the log shows the crash happens immediately after "applying tui config", while the following escape sequences are being sent (terminal capability negotiation / alternate screen entry):

[?2031h ]10;? ]11;? [>0q [?25l [s [6n [?1016$p [?2027$p [?2031$p [?1004$p [?2004$p [?2026$p [?u ]99;i=opentui-notifications:p=?; ]1337;Capabilities [H ]66;w=1; [6n [H ]66;s=2; [u [s [?1049h [>4;1m [?2027h [?2004h [14t

The process dies right around/after [?1049h (enter alternate screen) and [14t (report window size in pixels — not supported by classic Windows consoles, possibly related). Nothing further is logged; no exception, no stack trace, no OpenTUI error — just the raw OS-level access violation.

Expected behavior
The TUI should launch normally (as it does, presumably, on x64-native Windows).

Workaround found
opencode run "<message>" (non-interactive, no alternate-screen TUI) works reliably and repeatedly — confirmed across multiple runs, correctly picks up project config/model. So this appears isolated specifically to the OpenTUI full-screen renderer's Windows console capability-negotiation code path, not to opencode/Bun generally on this machine.

Hypothesis
Given this is a Windows-on-ARM device, and the crash is specifically located in native console-capability-query/response handling code that behaves fine when the same x64 binary runs on native x64 Windows, this may be a bug in how OpenTUI's native (Zig, via bun:ffi) console I/O code behaves when the process itself is running under Windows' x64-on-ARM emulation (Prism/xtajit) — e.g. a race condition or unexpected response format/timing when reading back the terminal's response to a DSR/capability query through the emulation layer, causing an out-of-bounds read in the native parser.

Happy to provide more logs / test patches if useful — this exact crash is 100% reproducible on this machine.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or related to existing issues. Please check:

  2. zudanis commented on Aug 8, 2026

    @zudanis
    Author
  3. github-actions commented on Oct 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions