From 0cde1a7537cd9f88b2f97f3c51b54669d909b597 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 17:03:07 -0300 Subject: A focus moved over 9P tells the programs that asked for focus reports, as a click does A program that set DECSET 1004 heard `CSI O` and `CSI I` when the keyboard moved by a click, a key or the window's focus, because update() checks after each event. A /focus write went through serveFs, which never did, so the program kept believing it had focus until the next input event. serveFs now runs the same check once a request has settled. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 402b3cd8..3a6e154a 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5733,6 +5733,9 @@ pub const Pardes = struct { // the end of whatever the editor does next. p.sync(); p.fsReport(); + // A /focus write moves the keyboard as a click does: the programs + // that asked (DECSET 1004) hear it now, as after update(). + p.reportFocus(); ctlfs.events.announce(p); return reply; } -- cgit v1.3