csi: focus mode (private mode 1004): send focus event immediate, when enabled

This lets the application now the current state, without having to
wait for the user to switch focus.

Fixes #2202
This commit is contained in:
Daniel Eklöf 2025-10-30 06:29:51 +01:00
parent 143f220527
commit 9728ada028
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 10 additions and 0 deletions

View file

@ -70,6 +70,14 @@
## Unreleased
### Added
### Changed
* When enabling _"focus mode"_ (private mode 1004), foot now sends a
focus event immediately, to inform the application what the current
state is ([#2202][2202]).
[2202]: https://codeberg.org/dnkl/foot/issues/2202
### Deprecated
### Removed
### Fixed

2
csi.c
View file

@ -422,6 +422,8 @@ decset_decrst(struct terminal *term, unsigned param, bool enable)
case 1004:
term->focus_events = enable;
if (enable)
term_to_slave(term, term->kbd_focus ? "\033[I" : "\033[O", 3);
break;
case 1005: