aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-10-30 05:29:51 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-11-01 07:12:03 +0000
commit9728ada0289c446585325a74ded9c94958d9ab24 (patch)
tree5524b72fdaa96701a1915be8bfdffd4727031169
parentsearch: do not emit composing keys (diff)
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
-rw-r--r--CHANGELOG.md8
-rw-r--r--csi.c2
2 files changed, 10 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f00b5d15..21d2c5f5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/csi.c b/csi.c
index 437fd8bc..c5f616ac 100644
--- a/csi.c
+++ b/csi.c
@@ -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: