Skip to content

[FEATURE]:TUI crashes with STATUS_ACCESS_VIOLATION (0xC0000005) during terminal capability negotiation on Windows on ARM (Snapdragon X Elite) #41094

Closed

Description

@zudanis

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

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.

Activity

  1. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Wrong template used: this is a bug report (crash with steps to reproduce, actual/expected behavior, error codes), but it was submitted using the Feature Request template. Please re-submit using the Bug Report template, or at minimum update the title to remove the [FEATURE]: prefix and retitle appropriately (e.g. [BUG]: TUI crashes with STATUS_ACCESS_VIOLATION during terminal capability negotiation on Windows on ARM).

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

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

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions