Skip to content

BUG(tui): Ctrl+Z (terminal_suspend) broken on Windows -- SIGTSTP is not a valid signal #19349

Description

@mynameistito

Description

Ctrl+Z is mapped to terminal_suspend by default. The handler at app.tsx:647-655 calls process.kill(0, "SIGTSTP"), which is a POSIX-only signal. On Windows this throws or silently fails, and renderer.suspend() runs but the process never actually suspends. The terminal gets left in a broken state with no way back.

There's also a misleading tip at tips.tsx:151 that tells Windows users to "Press Ctrl+Z to suspend the terminal and return to your shell", which doesn't work.

I tested on both the latest Windows Terminal and Windows Terminal Preview on Windows 11, OpenCode v1.3.3.

There's an existing PR (#16120) that adds an early return on win32, making Ctrl+Z a no-op. I think it'd be better to call exit() instead, since that's the closest thing to "get me back to my shell" on a platform without job control. The exit() function is already in scope and handles renderer cleanup, buffer flushing, and the Ctrl+C guard teardown.

Two files, roughly 8-10 lines:

  1. packages/opencode/src/cli/cmd/tui/app.tsx (~line 647): add a process.platform === "win32" check, call exit() on Windows instead of renderer.suspend() + SIGTSTP
  2. packages/opencode/src/cli/cmd/tui/component/tips.tsx (line 151): conditionally hide the Ctrl+Z tip on Windows

Related: #16050, #6517, PR #16120

Plugins

Not relevant

OpenCode version

1.3.3

Steps to reproduce

  1. Launch opencode on Windows 11
  2. Press Ctrl+Z
  3. The terminal breaks or the app throws

Screenshot and/or share link

2026-03-27.13-06-40.mp4

Operating System

Windows 11

Terminal

Windows Terminal, Windows Terminal Preview

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions