[FEATURE]: Add focus/attention change events to plugin API #6250

Open
opened 2026-02-16 18:02:14 -05:00 by yindo · 0 comments
Owner

Originally created by @ctbk on GitHub (Jan 15, 2026).

Originally assigned to: @thdxr on GitHub.

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

  • Problem: Plugins can’t reliably tell whether the OpenCode terminal had focus when events fired (e.g. session idle), which makes (for example) notification decisions harder.
  • Proposal: Introduce a small, focus/attention event (e.g. tui.focus.change or similar) emitted when the terminal gains/loses focus, and emitted once on startup/subscription to provide initial state.
  • Outcome: Plugins can track current terminal attention state without per‑frontend hacks;
Originally created by @ctbk on GitHub (Jan 15, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request - Problem: Plugins can’t reliably tell whether the OpenCode terminal had focus when events fired (e.g. session idle), which makes (for example) notification decisions harder. - Proposal: Introduce a small, focus/attention event (e.g. tui.focus.change or similar) emitted when the terminal gains/loses focus, and emitted once on startup/subscription to provide initial state. - Outcome: Plugins can track current terminal attention state without per‑frontend hacks;
yindo added the discussion label 2026-02-16 18:02:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6250