diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 03:44:26 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 69f8e4703f6c1204f9f0958f264d2a4c4600026f (patch) | |
| tree | 01bab7f3d7cea8a557780c0e1263962752892732 /src/detached | |
| parent | 29ae6460961f4f781088455b72946260113a9ad9 (diff) | |
| download | pardes-69f8e4703f6c1204f9f0958f264d2a4c4600026f.tar.gz pardes-69f8e4703f6c1204f9f0958f264d2a4c4600026f.zip | |
pty/run's busy names the program holding the terminal
busy said only that something ran. Where the host can tell (Linux, the
tty's foreground group's /proc comm, a new fg_name host call), it says
busy: <program> is running; elsewhere, busy as before. The GUI's host
gains the one small callback (render agent's file: gui.zig, fgName).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/detached')
| -rw-r--r-- | src/detached/server.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/detached/server.zig b/src/detached/server.zig index af299051..bb66b841 100644 --- a/src/detached/server.zig +++ b/src/detached/server.zig @@ -373,6 +373,7 @@ pub const Session = struct { .pty_signal = ptySignal, .close_pty = closePaneShell, .tty_taken = ttyTaken, + .fg_name = fgName, .kill_job = killJob, .write_file = writeFile, .write_dump = writeDump, @@ -544,6 +545,14 @@ pub const Session = struct { return host_io.ttyTaken(pt.pid, pt.fd); } + fn fgName(ctx: ?*anyopaque, pane: u8, buf: []u8) ?[]const u8 { + const s = of(ctx); + if (pane >= s.ptys.len) return null; + const pt = s.ptys[pane]; + if (pt.fd < 0) return null; + return host_io.foregroundName(pt.pid, pt.fd, buf); + } + fn killJob(ctx: ?*anyopaque, pane: u8) bool { const s = of(ctx); if (pane >= s.ptys.len) return false; |
