opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open ctbk opened this issue 1 day ago • 1 comments

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;

ctbk avatar Jan 15 '26 15:01 ctbk