[FEATURE]: When GUI gains windows focus it should make the input chat bot also in focus
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
When the GUI gains focus it doesn't automatically guarantee the input text box also gains focus. For ease of use the text box should be automatically focused when the window gains focus.
Steps to replicate
- Have OpenCode 2.x GUI in focus
- Click text box input window
- Click the chat area (not the text box)
- Switch to another program, ALT+TAB back, since text box wasn't in focus previously in window, it remains not in focus now.
Thanks for the suggestion, @binbuf! You'd like the prompt to get focus automatically whenever the OpenCode window comes back into focus (e.g. after Alt+Tab), even if you last clicked somewhere else in the app, such as the chat area.
Right now the app works as built: when the window gets focus back, focus goes to whatever was focused before you switched away. So I've filed this as a feature request for the maintainers to consider.
Related issues:
- #47514: refocus the prompt when switching tabs with Cmd+number
- #57176: the composer losing focus after every agent turn
- #9023: an earlier case where input auto-focus that was too aggressive got in the way of scrolling and the terminal, which is worth keeping in mind for how this should behave
Thanks for the suggestion, @binbuf. We've decided not to do this.\n\nWhen the window comes back into focus, the app returns focus to whatever had it before you switched away. That's deliberate: if you were reading or scrolling the timeline, working in a panel, or using the terminal, moving focus to the composer would take you away from it, as the over-eager auto-focus in #9023 did.\n\nClicking the composer puts the caret back in it. Closing this as not planned.