opencode
opencode copied to clipboard
[FEATURE]: Add focus/attention change events to plugin API
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;