diff options
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 002ff6f9..3a574dc9 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5010,6 +5010,7 @@ pub const Pardes = struct { pub fn acknowledgeShell(p: *Pardes, id: usize, executable: []const u8, prompt_marks: bool) void { if (id < MAX_PANES) if (p.panes[id]) |pane| { ctlfs.pty.shellGone(p, pane, true); // a respawn replaced whatever ran + pane.shell_failed = false; pane.fs.unmarked = !prompt_marks; // The tag's Tty word names the shell the host ran, and a click // on it (`Tty+fish`) opens another of the same. @@ -5230,6 +5231,16 @@ pub const Pardes = struct { p.emit(.{ .watch = .{ .pane = id, .on = true } }); } + /// A terminal whose shell could not be started: said, and a run waiting + /// on it, or written to it from now on, hears `error shell gone` + /// rather than wait for a prompt that never comes. + pub fn shellFailed(p: *Pardes, id: u8, err: anyerror) void { + const pane = p.panes[id] orelse return; + pane.shell_failed = true; + ctlfs.pty.shellGone(p, pane, false); + p.reportError(id, "shell", err); + } + pub fn saveFailed(p: *Pardes, id: u8, path: []const u8, err: anyerror) void { if (p.panes[id]) |pane| if (pane.file) |*f| { // The `-%` spelling fs.zig already uses for "make this dirty". |
