summaryrefslogtreecommitdiff
path: root/core/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 06:56:46 -0300
committerGabriel Schneider <[email protected]>2026-11-20 06:56:46 -0300
commit2c2800c93e5417297dd06d3e52d5d336d975560c (patch)
treea028181f6c0fa1115df2f4862622fefb954a62d5 /core/panes.zig
parentffe05cceb897b3ae6a6d36491f9318a8aa3426e7 (diff)
parent0165bc532446e61a74af604c493d6b354abf798a (diff)
downloadpardes-2c2800c93e5417297dd06d3e52d5d336d975560c.tar.gz
pardes-2c2800c93e5417297dd06d3e52d5d336d975560c.zip
integration: a client that joins during a 9P pty/run replays it as its session does, and a far client's Del question is instant, on the build's second pass: pardes-faults-3 (a 9P open's handle is the session's recorded answer; a run reads its terminal's prompt marks through the tape's prompt site; a rejoin that lands as the session ends says so; Del sets question_asked and the host's pump gives it its time: the step reads no clock, so the bytes soak's one stop off may_wait, now, is gone) and pardes-merge32, merged without a textual conflict; the coordinator's gate in the ledger (reorg/merge33)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/panes.zig')
-rw-r--r--core/panes.zig14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/panes.zig b/core/panes.zig
index 574c697e..1c103bd1 100644
--- a/core/panes.zig
+++ b/core/panes.zig
@@ -53,6 +53,10 @@ pub const Pane = struct {
return @backingInt(id);
}
};
+ /// Del's question asked, its time not had yet: the step that asks
+ /// reads no clock (a far client's would wait on the session's), and
+ /// core time is the last frame's, seconds old in an idle session.
+ pub const question_asked: u64 = std.math.maxInt(u64);
/// The words that throw unsaved text away (builtins.zig warnModified).
pub const Discarding = enum { Exit, Restore, get, Del, Delcol };
@@ -218,7 +222,9 @@ pub const Pane = struct {
repl_enter: u8 = 0,
repl_enter_due_ns: u64 = 0,
/// When Del's question (`del_side`) goes up on the notice band, on the
- /// shell's clock (config.del_question_delay_ns after it was asked).
+ /// shell's clock (config.del_question_delay_ns after it was asked):
+ /// `question_asked` until the next advance, which counts the delay
+ /// from its own time (Core.advance).
question_due_ns: u64 = 0,
/// A question with its answers in it (`repl_choice`).
question: [96]u8 = undefined,
@@ -1026,11 +1032,11 @@ pub const Pane = struct {
/// started, for Kill: it runs from the shell's next C mark to its D.
/// ponytail: of several lines queued for a shell not up yet, only the
/// last is remembered, as the first of them.
- pub fn noteCommand(pane: *Pane, line: []const u8) void {
- const state = pane.terminal orelse return;
+ pub fn noteCommand(pane: *Pane, line: []const u8, started: u32) void {
+ if (pane.terminal == null) return;
const said = std.mem.trim(u8, line, " \t");
const word = said[0 .. std.mem.indexOfAny(u8, said, " \t") orelse said.len];
- var sent: @typeInfo(@FieldType(Pane, "sent_command")).optional.child = .{ .seq = Term.prompt(state).started +% 1 };
+ var sent: @typeInfo(@FieldType(Pane, "sent_command")).optional.child = .{ .seq = started +% 1 };
sent.len = @intCast(@min(word.len, sent.word.len));
@memcpy(sent.word[0..sent.len], word[0..sent.len]);
pane.sent_command = sent;