-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Support focus gain/loss events #558
Comments
This would be extremely useful for applications like senpai (IRC client) to decide when to show desktop notifications or update internal read states. |
This is a good idea. I think its fairly widely supported. I haven't done it mostly because I didn't think there was a need for it, and I haven't had time, but as there is a good use case for it, I'll see if I can add it pretty soon. |
I support this request. I would like to start two similar file-manager applications in tmux and only highlight the selected item in a list if the application has focus. |
I would very much like to have this too. In lazygit this could be used to refresh the git state when receiving focus; many GUI git clients do this. |
I decided to give it a try, see #599. I'm still quite new to go, and I don't have much experience with terminal emulation, so please be gentle... |
This is fixed .. although not implemented for Windows yet. Try 2.7.0 out. A ticket requesting this for Windows is opened. |
Focus gain and loss events are supported by at least xterm, kitty, Chrome OS default terminal (based on hterm, I think), and tmux (which might support them to a large degree even if the parent terminal doesn't; I'm not 100% sure). They are nicely described in Vim help.
As of tcell 2.3.1 (sorry I didn't test a more recent version), if one forces focus events on with
fmt.Print("\x1b[?1004h")
, subsequent focus events each result intcell
sending twoEventKey
events (<a-[>
thenI
orO
). It would be nice if these events were supported bytcell
directly.The text was updated successfully, but these errors were encountered: