opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Rider TUI - Ctrl+Z uses EOF - unable to return to session

Open pawelel opened this issue 2 weeks ago • 2 comments

Description

When using Ctrl+Z on Windows 11 under JetBrains Rider/IntelliJ, there is no option to return - terminal is suspended, not only opencode. Additionaly CTRL+C with radio button ends with typing any movement of the mouse

Image

OpenCode version

v1.0.218

Steps to reproduce

  1. Open instance under IntelliJ engine TUI
  2. use Ctrl+Z
  3. Try to return
  4. Enter will disable any inputs Image
Image

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Powershell 7 Reworked 2025

pawelel avatar Dec 31 '25 07:12 pawelel

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

  • #3941: Terminal in JetBrains IDE doesn't work properly (can't type or paste multiline commands)
  • #532: TUI isn't usable in Intellij's terminal
  • #3737: OpenTUI: ctrl-z background controls are broken
  • #5043: Suspend (ctrl + z) pauses api calls for all opencode instances

The core issue appears to be related to OpenCode's behavior in JetBrains IDEs with Ctrl+Z handling and terminal integration. These existing issues may have solutions or workarounds that could help.

Feel free to ignore if your specific case differs from these.

github-actions[bot] avatar Dec 31 '25 07:12 github-actions[bot]

Clarification about Ctrl+Z on Windows (non-WSL environments)

This issue is not about broken POSIX job control.

On native Windows terminals (JetBrains Rider / IntelliJ terminal, PowerShell, cmd), Ctrl+Z does not send SIGTSTP and does not suspend the process. It is treated as EOF / input termination.

Because of that:

there is no suspended job,

fg / bg semantics do not exist,

the session cannot be resumed by design.

In Rider on Windows, pressing Ctrl+Z immediately breaks the TUI session because stdin is closed, not because OpenCode mishandles backgrounding.

So the problem is that the TUI appears to assume Unix-like job control even when running on native Windows, where this concept does not exist.

This should either:

disable Ctrl+Z handling entirely on non-WSL Windows, or

be documented as unsupported behavior in Windows IDE terminals (with an option to change keybindings)

For comparison, this works as expected in WSL or on Linux/macOS shells, where Ctrl+Z maps to SIGTSTP.

pawelel avatar Dec 31 '25 07:12 pawelel

disable Ctrl+Z handling entirely on non-WSL Windows, or

I think this is reasonable

rekram1-node avatar Dec 31 '25 18:12 rekram1-node