diff options
Diffstat (limited to 'core/panes.zig')
| -rw-r--r-- | core/panes.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/panes.zig b/core/panes.zig index fd152e1e..d8e1bbcb 100644 --- a/core/panes.zig +++ b/core/panes.zig @@ -1026,11 +1026,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; |
