diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 14:20:10 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | 17c0d06618085de8d0bbf8152750ffa862db0080 (patch) | |
| tree | 71a2d33dcf14e4e95387f3aa556e9952135de894 /src/tty | |
| parent | b546b578baadbd8fdd15b42988ad4d66c9c8ff21 (diff) | |
| download | pardes-17c0d06618085de8d0bbf8152750ffa862db0080.tar.gz pardes-17c0d06618085de8d0bbf8152750ffa862db0080.zip | |
A program that asked for focus reports (1004) hears CSI I when its pane takes the keyboard and CSI O when it gives it up, to another pane, a tag or another window
The core has a window-focus event now, from SDL's window focus and from
the tty's own focus reports (vaxis turns 1004 on outside); the detached
wire carries it: version 10. The test shell's ESC]777;mouse;focus;<1|0>
fakes the window's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/tty')
| -rw-r--r-- | src/tty/tty.zig | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig index 0b933065..67807cd5 100644 --- a/src/tty/tty.zig +++ b/src/tty/tty.zig @@ -1469,8 +1469,11 @@ const Shell = struct { core.quit = true; return true; }, - .focus_in => {}, - .focus_out => core.update(.pointer_leave), + .focus_in => core.update(.{ .focus = true }), + .focus_out => { + core.update(.pointer_leave); + core.update(.{ .focus = false }); + }, .winsize => |ws| { s.vx.resize(s.gpa, s.tty.writer(), ws) catch {}; if (comptime pardes.pdf_enabled) @@ -2674,8 +2677,11 @@ const Attach = struct { switch (event) { .nop, .wake, .fs_ready, .lsp_done, .lsp_status, .pipe_done, .pty_read, .pty_eof, .files_changed => {}, .quit => return .none, - .focus_in => {}, - .focus_out => return a.send(.pointer_leave), + .focus_in => return a.send(.{ .focus = true }), + .focus_out => { + if (a.send(.pointer_leave)) |end| return end; + return a.send(.{ .focus = false }); + }, .winsize => |ws| { a.vx.resize(a.gpa, a.tty.writer(), ws) catch {}; a.dirty = true; |
