diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 15:39:33 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 28a055dcee3423e8cf181b5e46c889d3cd522017 (patch) | |
| tree | 4938d340159e5f8e0fad2e82b83febe85b56bd2d /src/exec.zig | |
| parent | f2091c52e06b0935f69914ac2d76941361cbb969 (diff) | |
| download | pardes-28a055dcee3423e8cf181b5e46c889d3cd522017.tar.gz pardes-28a055dcee3423e8cf181b5e46c889d3cd522017.zip | |
The log's run record carries the whole command line, after the new record of its pane
run logged the line's first word only, and before the new record of the pane
it ran in, since panes are announced at the end of a step. It now carries the
whole line as msg carries its text (control characters, newlines too, as
spaces), and announces the new pane first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/exec.zig b/src/exec.zig index fa915b16..cc2d3c4f 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -572,11 +572,13 @@ fn echoCommand(p: *Pardes, pane: *Pane, line: []const u8) void { } /// `run <serial> <word>` or `exit <serial> <N|?>` in the log. +/// The whole line, one record as `msg` carries its text: its control +/// characters, a newline too, become spaces (events.pushLog). A new pane is +/// announced first, so `new` comes before the `run` in it. fn noteRun(p: *Pardes, pane: *Pane, what: []const u8, said: []const u8) void { - var buf: [96]u8 = undefined; - const word = std.mem.trim(u8, said, " \t"); - const first = word[0 .. std.mem.indexOfAny(u8, word, " \t") orelse word.len]; - pardes.ctlfs.events.notePath(p, what, std.fmt.bufPrint(&buf, "{d} {s}", .{ pane.serial, first[0..@min(first.len, 64)] }) catch return); + pardes.ctlfs.events.announce(p); + var buf: [command_max + 16]u8 = undefined; + pardes.ctlfs.events.notePath(p, what, std.fmt.bufPrint(&buf, "{d} {s}", .{ pane.serial, std.mem.trim(u8, said, " \t\r\n") }) catch return); } /// A command pane's child is gone: the pane stays, showing what it said |
