summaryrefslogtreecommitdiff
path: root/core/exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/exec.zig')
-rw-r--r--core/exec.zig21
1 files changed, 13 insertions, 8 deletions
diff --git a/core/exec.zig b/core/exec.zig
index ad1cefea..5a5ff725 100644
--- a/core/exec.zig
+++ b/core/exec.zig
@@ -617,8 +617,7 @@ pub fn sendToRepl(p: *Pardes, from: usize, to: usize, text: []const u8) void {
p.setMessage(.at(from), warn.print("Repl: {s} takes no bracketed paste; a blank line in a block ends it", .{id}));
}
var said: pardes.Kind.Buf(64) = .{};
- p.setMessage(.at(from), said.print("\u{2192} {s}", .{id}));
- src.msg_sent = true;
+ _ = pardes.Messages.say(p, .echo, from, said.print("\u{2192} {s}", .{id}));
var rec: [96]u8 = undefined;
pardes.ctlfs.events.notePath(p, "send", std.fmt.bufPrint(&rec, "{d} {d} {s}", .{ src.serial, dst.serial, id }) catch return);
}
@@ -634,6 +633,8 @@ const max_exec_depth = 8;
/// child is `$SHELL -c` the line, which shows its output and `exit N` when
/// done, and which Kill signals. Answers the pane it went to.
pub fn execute(p: *Pardes, id: usize, txt: []const u8) ?usize {
+ // A question's answer word, on the pane it waits on (B2 on `Reload`).
+ if (pardes.Messages.answerWord(p, id, txt)) return null;
return executeFrom(p, id, txt, false);
}
@@ -761,6 +762,11 @@ pub fn runCommand(p: *Pardes, from: usize, line: []const u8) ?usize {
pane.command_done = false;
pane.command_status = null;
pane.command_pty = true;
+ // Its last run's errors go with it (SPEC ยง11).
+ var i: usize = 0;
+ while (i < p.messages.live_len) {
+ if (p.messages.live[i].pane == pane.serial and p.messages.live[i].kind == .@"error") p.messages.remove(i) else i += 1;
+ }
pane.body.mode = .tty;
// What the last program left the emulator in goes first: the
// alternate screen left (only if it is there: leaving restores a
@@ -976,15 +982,14 @@ pub fn runBuiltinFrom(p: *Pardes, b: Builtin, id: usize, txt: []const u8, arg: ?
// No pane at all (the window Delcol emptied): a word runs all the same,
// with a stand-in that is no pane (New, Newcol, Exit are what make sense).
const pane = p.panes[id] orelse (if (builtins.registry.scope(b) == .session or panes.anyPane(p) == null) panes.standIn(p) orelse return else return);
- // A builtin says its own name before it runs, so a tagline click is
- // legible even when what it did is invisible. Whatever the builtin
- // then says for itself replaces the announcement. It is the message
- // row's only, never /log's: a msg record is something said.
+ // A builtin says its own name before it runs, an echo, so a tagline
+ // click is legible even when what it did is invisible. Whatever the
+ // builtin then says for itself retires it. It is the message row's
+ // only, never /log's: a msg record is something said.
if (p.announce and p.settings.verbose and builtins.registry.announces(b)) {
p.fs.unlogged = true;
- p.setMessage(.at(id), @tagName(b));
+ _ = pardes.Messages.say(p, .echo, id, @tagName(b));
p.fs.unlogged = false;
- pane.msg_announcement = true;
}
// A word for one kind of pane, on another: refused with why, not a
// silent nothing (Palette on a file, Filter on a PDF).