summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-09 03:31:33 -0300
committerGabriel Schneider <[email protected]>2026-11-09 03:31:33 -0300
commit396791f7ca7a03d1cb58a9db35d4d4314ee0c6e9 (patch)
tree2d9c52d356ad1149dae7d6d61efb54d477f2e4df /src
parent84c8209d02f6830db861c3a8dde0c710c88075f0 (diff)
downloadpardes-396791f7ca7a03d1cb58a9db35d4d4314ee0c6e9.tar.gz
pardes-396791f7ca7a03d1cb58a9db35d4d4314ee0c6e9.zip
idioms: the terminal host's tasks say what they fail with: readPty returns error{OutOfMemory} and watchFiles nothing, their futures typed so, for anyerror
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src')
-rw-r--r--src/tui/tui.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tui/tui.zig b/src/tui/tui.zig
index d5d3a782..af274b3f 100644
--- a/src/tui/tui.zig
+++ b/src/tui/tui.zig
@@ -380,7 +380,7 @@ const PipeTasks = selection_pipe.Tasks;
const Pty = struct {
file: std.Io.File,
pid: posix.pid_t,
- reader: std.Io.Future(anyerror!void),
+ reader: std.Io.Future(error{OutOfMemory}!void),
/// A command pane's child, watched to its exit (host_io.watchExit);
/// the pty stays open until both its end of file and its exit.
cmd: host_io.CommandWatch = .{},
@@ -1030,7 +1030,7 @@ fn localSession(
core.stream.cancelTask();
file_watch.stop(sh.inotify_fd);
if (sh.watch_task) |*t| {
- t.cancel(io) catch {};
+ t.cancel(io);
sh.watch_task = null;
}
if (sh.inotify_fd >= 0) {
@@ -1196,7 +1196,7 @@ const Shell = struct {
ptys: [pardes.MAX_PANES]?Pty = @splat(null),
gens: [pardes.MAX_PANES]u32 = @splat(0),
watches: file_watch.Table = @splat(null),
- watch_task: ?std.Io.Future(anyerror!void) = null,
+ watch_task: ?std.Io.Future(void) = null,
lsp_task: ?host_io.Lsp.Task = null,
pipe_tasks: PipeTasks = .{},
job_tasks: PipeTasks = .{},
@@ -2223,7 +2223,7 @@ fn lspStatusSink(ctx: ?*anyopaque, text: []const u8) void {
if (!posted) s.lsp_gpa.free(copy);
}
-fn watchFiles(io: std.Io, fd: c_int, loop: *Loop) anyerror!void {
+fn watchFiles(io: std.Io, fd: c_int, loop: *Loop) void {
if (comptime builtin.os.tag != .linux and builtin.os.tag != .freebsd) {
while (file_watch.wait(fd)) loop.postEvent(.files_changed) catch break;
return;
@@ -2325,7 +2325,7 @@ fn tookRead(io: std.Io, id: usize) void {
};
}
-fn readPty(io: std.Io, gpa: std.mem.Allocator, pty: std.Io.File, id: usize, gen: u32, loop: *Loop) anyerror!void {
+fn readPty(io: std.Io, gpa: std.mem.Allocator, pty: std.Io.File, id: usize, gen: u32, loop: *Loop) error{OutOfMemory}!void {
// One buffer, read into directly: a Reader around it only added a second
// (and in a safe build, filled both as `undefined` on every start).
var buf: [0x10000]u8 = undefined;