anomalyco / anomalyco/opencode

SIGUSR2 theme reload interrupts an in-flight session

Open
#42,621 0 comments 0 reactions 1 assignee View on GitHub

@simonklee is already working on this.

Since Aug 14, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Changing the desktop theme while opencode is working interrupts the run.

Omarchy signals opencode on every theme change — omarchy-restart-opencode runs killall -SIGUSR2 opencode. In the TUI, SIGUSR2 calls the worker's reload RPC (packages/opencode/src/cli/cmd/tui.ts:216), and that reload invalidates config and then disposes every instance (packages/opencode/src/cli/tui/worker.ts:63). Disposing an instance cancels the session runners it owns, so whatever is in flight — a model stream or a shell command — is aborted.

The theme itself does not depend on that reload: the TUI re-detects the terminal palette and re-scans theme files from its own SIGUSR2 handler in packages/tui/src/context/theme.tsx.

OpenCode version

1.18.18, also reproduced on dev @ e23586af2

Steps to reproduce
  1. Start the TUI.
  2. Start something long-running, e.g. !sleep 45.
  3. From another terminal, kill -SIGUSR2 <tui pid> (this is what an Omarchy theme switch does).
  4. The run is aborted immediately with "User aborted the command", and the log shows disposing all instances within milliseconds of the signal.
Operating System

Arch Linux (Omarchy), Hyprland

Terminal

foot

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.