summaryrefslogtreecommitdiff
path: root/dev/gui/gui.zig
diff options
context:
space:
mode:
Diffstat (limited to 'dev/gui/gui.zig')
-rw-r--r--dev/gui/gui.zig126
1 files changed, 70 insertions, 56 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index 3d050bbf..c147c2e2 100644
--- a/dev/gui/gui.zig
+++ b/dev/gui/gui.zig
@@ -1130,7 +1130,7 @@ const Own = struct {
pub fn start(o: *Own, l: *Session) !void {
for (&o.ptys, 0..) |*slot, id| if (slot.*) |*pt| {
- pt.reader = try o.queue.startReader(.{ .handle = pt.fd, .flags = .{ .nonblocking = false } }, @intCast(id), o.gens[id]);
+ pt.reader = try o.queue.startReader(.{ .handle = pt.fd, .flags = .{ .nonblocking = false } }, .at(id), o.gens[id]);
};
if (o.inotify_fd >= 0) {
o.watch_stop = try stopPipe();
@@ -2485,7 +2485,8 @@ const Shell = struct {
took_input: bool = false,
held: ?c.SDL_Event = null,
- fn closePaneShell(ctx: ?*anyopaque, pane: u8) void {
+ fn closePaneShell(ctx: ?*anyopaque, id: pardes.Pane.Id) void {
+ const pane = id.index();
shellOf(ctx).closePty(pane);
}
@@ -2493,7 +2494,7 @@ const Shell = struct {
const pt = if (s.ptys[pane]) |*pt| pt else return;
// Out of the queue first, which lets go a reader waiting for room
// in it; then its read is canceled (or, at its end, it is joined).
- s.queue.cancelReader(pane, s.gens[pane]);
+ s.queue.cancelReader(.at(pane), s.gens[pane]);
if (pt.reader) |*reader| {
reader.cancel(s.queue.io); // the Io it was started on (startReader)
pt.reader = null;
@@ -2603,12 +2604,14 @@ const Shell = struct {
return shellOf(ctx).gui != null;
}
- fn adopt(ctx: ?*anyopaque, pane: u8) void {
+ fn adopt(ctx: ?*anyopaque, id: pardes.Pane.Id) void {
+ const pane = id.index();
const s = shellOf(ctx);
s.adoptions.ask(s.core, pane);
}
- fn upgradeAsked(ctx: ?*anyopaque, pane: u8) void {
+ fn upgradeAsked(ctx: ?*anyopaque, id: pardes.Pane.Id) void {
+ const pane = id.index();
const s = shellOf(ctx);
if (comptime !upgrade.supported) return s.core.reportFailure(pane, "Upgrade: this system cannot move a session to another build in place");
s.upgrade_asked = pane;
@@ -2656,7 +2659,7 @@ const Shell = struct {
const failed = upgrade.dumpInto(core, &rec, &at_buf, &why) orelse upgrade.execAs(s.gpa, path, &rec, &at_buf, s.fs, &why);
// As it was: its ptys read on.
for (s.ptys, 0..) |*slot, id| if (slot.*) |*pt| if (pt.fd >= 0 and pt.reader == null) {
- pt.reader = s.queue.startReader(.{ .handle = pt.fd, .flags = .{ .nonblocking = false } }, @intCast(id), s.gens[id]) catch null;
+ pt.reader = s.queue.startReader(.{ .handle = pt.fd, .flags = .{ .nonblocking = false } }, .at(id), s.gens[id]) catch null;
};
core.reportFailure(pane, failed);
}
@@ -2751,18 +2754,18 @@ const Shell = struct {
var check_files = false;
for (msgs.slice()) |m| switch (m) {
.output => |o| {
- if (s.gens[o.pane] == o.gen)
+ if (s.gens[o.pane.index()] == o.gen)
s.core.update(.{ .output = .{ .pane = o.pane, .bytes = o.bytes } });
s.gpa.free(o.bytes);
},
.eof => |e| {
- if (s.gens[e.pane] == e.gen) eof: {
+ if (s.gens[e.pane.index()] == e.gen) eof: {
if (e.failure) |err| {
- s.closePty(e.pane);
- s.core.readerFailed(.at(e.pane), err);
+ s.closePty(e.pane.index());
+ s.core.readerFailed(e.pane, err);
break :eof;
}
- const pt = if (s.ptys[e.pane]) |*pt| pt else {
+ const pt = if (s.ptys[e.pane.index()]) |*pt| pt else {
s.core.update(.{ .eof = .{ .pane = e.pane } });
break :eof;
};
@@ -2770,15 +2773,15 @@ const Shell = struct {
// closing it would hang up one that runs on without it.
// Its exit, if it came first, is told now its output is in.
if (pt.cmd.watched) {
- host_io.commandEof(s.core, s.ptys, e.pane, s, closeWatched);
+ host_io.commandEof(s.core, s.ptys, e.pane.index(), s, closeWatched);
break :eof;
}
// Unwatched, a command's exit is read here, as its end,
// and a shell's, for a run waiting on it and the log.
- const unwatched = if (s.core.panes[e.pane]) |pane| pane.command != null else false;
+ const unwatched = if (s.core.panes[e.pane.index()]) |pane| pane.command != null else false;
const status = host_io.exitStatus(pt.pid, 100);
if (status != null) pt.pid = 0; // reaped: no shell to retire
- s.closePty(e.pane);
+ s.closePty(e.pane.index());
if (unwatched or status != null) s.core.update(.{ .exited = .{ .pane = e.pane, .status = status } });
s.core.update(.{ .eof = .{ .pane = e.pane } });
}
@@ -3327,32 +3330,33 @@ fn guiNow(ctx: ?*anyopaque) u64 {
return s.test_clock orelse s.paced_ns orelse c.SDL_GetTicksNS();
}
-fn spawnPane(ctx: ?*anyopaque, pane: u8, cwd: []const u8) void {
+fn spawnPane(ctx: ?*anyopaque, id: pardes.Pane.Id, cwd: []const u8) void {
+ const pane = id.index();
const s = shellOf(ctx);
- if (s.adoptions.take(pane)) |a| return takeShell(s, pane, a);
+ if (s.adoptions.take(id)) |a| return takeShell(s, pane, a);
// The new shell starts before a running one goes: one that cannot
// start leaves the running one be (pty/ctl's exec).
const running = s.ptys[pane] != null;
const child = host_io.forkShell(s.core, pane, s.prompt_rcs, s.core.shellBin(), cwd, s.core.view().screen_h, s.core.view().screen_w) catch |err| {
- if (running) return s.core.restartFailed(.at(pane), err);
- return s.core.shellFailed(.at(pane), err);
+ if (running) return s.core.restartFailed(id, err);
+ return s.core.shellFailed(id, err);
};
s.closePty(pane);
if (s.ptys[pane] != null) {
_ = libc.close(child.file.handle);
host_io.retireShell(child.pid);
- return s.core.reportError(.at(pane), "shell", error.WorkersBusy);
+ return s.core.reportError(id, "shell", error.WorkersBusy);
}
s.gens[pane] +%= 1;
const command = s.core.panes[pane].?.command != null;
const pt: Pty = .{ .fd = child.file.handle, .pid = child.pid, .serial = s.core.panes[pane].?.serial, .cmd = .{ .watched = command and host_io.watchExit(child.pid), .fd = child.file.handle } };
s.ptys[pane] = pt;
var lbuf: [pardes.memory.limits.host_path_cap + 1]u8 = undefined;
- if (host_io.shellCwd(pt.pid, &lbuf)) |wd| s.core.setCwd(.at(pane), wd);
+ if (host_io.shellCwd(pt.pid, &lbuf)) |wd| s.core.setCwd(id, wd);
if (!s.threads_ok) return;
- s.ptys[pane].?.reader = s.queue.startReader(.{ .handle = pt.fd, .flags = .{ .nonblocking = false } }, pane, s.gens[pane]) catch |err| {
+ s.ptys[pane].?.reader = s.queue.startReader(.{ .handle = pt.fd, .flags = .{ .nonblocking = false } }, id, s.gens[pane]) catch |err| {
s.closePty(pane);
- return s.core.reportError(.at(pane), "terminal reader", err);
+ return s.core.reportError(id, "terminal reader", err);
};
}
@@ -3368,9 +3372,9 @@ fn takeShell(s: *Shell, pane: u8, a: host_io.Adoption) void {
if (host_io.shellCwd(a.pid, &lbuf)) |wd| s.core.setCwd(.at(pane), wd);
const tiny: posix.winsize = .{ .row = 1, .col = 1, .xpixel = 0, .ypixel = 0 };
_ = posix.system.ioctl(a.fd, TIOCSWINSZ, @intFromPtr(&tiny));
- if (s.core.panes[pane]) |pn| ptyResize(s, pane, @max(pn.cols, 1), @max(pn.rows, 1));
+ if (s.core.panes[pane]) |pn| ptyResize(s, .at(pane), @max(pn.cols, 1), @max(pn.rows, 1));
if (!s.threads_ok) return;
- s.ptys[pane].?.reader = s.queue.startReader(.{ .handle = a.fd, .flags = .{ .nonblocking = false } }, pane, s.gens[pane]) catch |err| {
+ s.ptys[pane].?.reader = s.queue.startReader(.{ .handle = a.fd, .flags = .{ .nonblocking = false } }, .at(pane), s.gens[pane]) catch |err| {
s.closePty(pane);
return s.core.reportError(.at(pane), "terminal reader", err);
};
@@ -3397,12 +3401,14 @@ fn deliverNote(ctx: *anyopaque, note: daemon.Note) void {
}
}
-fn ptyWrite(ctx: ?*anyopaque, pane: u8, bytes: []const u8) void {
+fn ptyWrite(ctx: ?*anyopaque, id: pardes.Pane.Id, bytes: []const u8) void {
+ const pane = id.index();
const s = shellOf(ctx);
if (s.ptys[pane]) |pt| _ = host_io.writeFd(pt.fd, bytes);
}
-fn ptyResize(ctx: ?*anyopaque, pane: u8, cols: u16, rows: u16) void {
+fn ptyResize(ctx: ?*anyopaque, id: pardes.Pane.Id, cols: u16, rows: u16) void {
+ const pane = id.index();
const s = shellOf(ctx);
if (s.ptys[pane]) |pt| {
const ws = host_io.ptyWinsize(s.core, cols, rows);
@@ -3410,31 +3416,36 @@ fn ptyResize(ctx: ?*anyopaque, pane: u8, cols: u16, rows: u16) void {
}
}
-fn ptySignal(ctx: ?*anyopaque, pane: u8, sig: pardes.PtySignal) void {
+fn ptySignal(ctx: ?*anyopaque, id: pardes.Pane.Id, sig: pardes.PtySignal) void {
+ const pane = id.index();
const s = shellOf(ctx);
// A command whose exit is recorded is reaped: its group may be another's.
if (s.ptys[pane]) |pt| if (!pt.cmd.exited) host_io.signalTty(pt.pid, pt.fd, sig, pt.cmd.watched);
}
-fn ttyTaken(ctx: ?*anyopaque, pane: u8) bool {
+fn ttyTaken(ctx: ?*anyopaque, id: pardes.Pane.Id) bool {
+ const pane = id.index();
const s = shellOf(ctx);
const pt = s.ptys[pane] orelse return false;
return host_io.ttyTaken(pt.pid, pt.fd);
}
-fn fgName(ctx: ?*anyopaque, pane: u8, buf: []u8) ?[]const u8 {
+fn fgName(ctx: ?*anyopaque, id: pardes.Pane.Id, buf: []u8) ?[]const u8 {
+ const pane = id.index();
const s = shellOf(ctx);
const pt = s.ptys[pane] orelse return null;
return host_io.foregroundName(pt.pid, pt.fd, buf);
}
-fn killJob(ctx: ?*anyopaque, pane: u8) bool {
+fn killJob(ctx: ?*anyopaque, id: pardes.Pane.Id) bool {
+ const pane = id.index();
const s = shellOf(ctx);
const pt = s.ptys[pane] orelse return false;
return host_io.killJob(pt.pid, pt.fd);
}
-fn writeFile(ctx: ?*anyopaque, pane: u8, path: []const u8, bytes: []const u8) void {
+fn writeFile(ctx: ?*anyopaque, id: pardes.Pane.Id, path: []const u8, bytes: []const u8) void {
+ const pane = id.index();
const s = shellOf(ctx);
host_io.writeFile(s.core, s.watches, pane, path, bytes);
}
@@ -3443,7 +3454,8 @@ fn writeDump(ctx: ?*anyopaque, bytes: []const u8) void {
host_io.writeDump(shellOf(ctx).core, bytes);
}
-fn watchFile(ctx: ?*anyopaque, pane: u8, _: []const u8, on: bool, mode: pardes.WatchMode) void {
+fn watchFile(ctx: ?*anyopaque, id: pardes.Pane.Id, _: []const u8, on: bool, mode: pardes.WatchMode) void {
+ const pane = id.index();
const s = shellOf(ctx);
if (file_watch.applyEffect(s.core, s.io, s.inotify_fd, s.watches, pane, on, mode))
s.queue.push(.files_changed);
@@ -3461,7 +3473,8 @@ fn watchTheme(ctx: ?*anyopaque, generation: u32, on: bool) void {
)) s.queue.push(.files_changed);
}
-fn dumpThemes(ctx: ?*anyopaque, pane: u8) void {
+fn dumpThemes(ctx: ?*anyopaque, id: pardes.Pane.Id) void {
+ const pane = id.index();
const s = shellOf(ctx);
host_io.dumpThemes(s.core, s.io, s.gpa, pane);
}
@@ -3501,7 +3514,7 @@ fn lsp(ctx: ?*anyopaque, req: host_io.Lsp.Request) void {
const s = shellOf(ctx);
if (s.threads_ok) return s.queue.startLsp(s.core, req);
s.core.update(.{ .lsp_resp = .{ .id = req.id, .rows = null } });
- s.core.reportError(.at(req.pane), "lsp", error.WorkersUnavailable);
+ s.core.reportError(req.pane, "lsp", error.WorkersUnavailable);
}
fn pipe(ctx: ?*anyopaque, id: u32) void {
@@ -3517,7 +3530,8 @@ fn kindDraw(ctx: ?*anyopaque, j: *host_io.KindJob) bool {
return (s.threads_ok or s.client != null) and host_io.KindJob.go(s.io, &s.job_tasks, j, s.queue, Queue.pushJob);
}
-fn kindJob(ctx: ?*anyopaque, pane: u8, serial: u32, token: u32) void {
+fn kindJob(ctx: ?*anyopaque, id: pardes.Pane.Id, serial: u32, token: u32) void {
+ const pane = id.index();
const s = shellOf(ctx);
if (s.threads_ok) return host_io.KindJob.start(s.io, s.core, &s.job_tasks, pane, serial, token, s.queue, Queue.pushJob);
host_io.KindJob.runHere(s.core, pane, serial, token);
@@ -6280,7 +6294,7 @@ test "GUI PTY reader delivers a real shell tail before EOF and joins on close" {
const rcs: host_io.Shell.PromptFiles = .{};
const child = try host_io.forkShell(null, 0, &rcs, "/bin/sh", "", 24, 80);
ptys[0] = .{ .fd = child.file.handle, .pid = child.pid, .serial = core.panes[0].?.serial };
- ptys[0].?.reader = try queue.startReader(.{ .handle = ptys[0].?.fd, .flags = .{ .nonblocking = false } }, 0, 1);
+ ptys[0].?.reader = try queue.startReader(.{ .handle = ptys[0].?.fd, .flags = .{ .nonblocking = false } }, .at(0), 1);
try std.testing.expect(host_io.writeFd(child.file.handle, "printf '\\120\\101\\122\\104\\105\\123\\055\\124\\101\\111\\114'; exit\n"));
var bytes: std.ArrayList(u8) = .empty;
defer bytes.deinit(gpa);
@@ -6317,8 +6331,8 @@ test "GUI PTY Restore joins a real reader waiting for queue space" {
try dump.dumpState(core);
var queue: Queue = .{ .io = std.testing.io, .gpa = gpa, .lsp_allocator = gpa };
defer queue.deinit();
- queue.acceptReader(1, 1);
- for (0..output_capacity) |_| queue.push(.{ .output = .{ .pane = 1, .gen = 1, .bytes = try gpa.dupe(u8, "other pane") } });
+ queue.acceptReader(.at(1), 1);
+ for (0..output_capacity) |_| queue.push(.{ .output = .{ .pane = .at(1), .gen = 1, .bytes = try gpa.dupe(u8, "other pane") } });
var ptys: [pardes.MAX_PANES]?Pty = @splat(null);
var gens: [pardes.MAX_PANES]u32 = @splat(1);
var shell: Shell = undefined;
@@ -6331,7 +6345,7 @@ test "GUI PTY Restore joins a real reader waiting for queue space" {
const rcs: host_io.Shell.PromptFiles = .{};
const child = try host_io.forkShell(null, 0, &rcs, "/bin/sh", "", 24, 80);
ptys[0] = .{ .fd = child.file.handle, .pid = child.pid, .serial = core.panes[0].?.serial };
- ptys[0].?.reader = try queue.startReader(.{ .handle = ptys[0].?.fd, .flags = .{ .nonblocking = false } }, 0, 1);
+ ptys[0].?.reader = try queue.startReader(.{ .handle = ptys[0].?.fd, .flags = .{ .nonblocking = false } }, .at(0), 1);
try std.testing.expect(host_io.writeFd(child.file.handle, "printf 'after-full'; exit\n"));
try host_io.PtyTests.waitBlocked(&queue);
const old_serial = core.panes[0].?.serial;
@@ -6345,10 +6359,10 @@ test "GUI PTY Restore joins a real reader waiting for queue space" {
try std.testing.expectEqual(@as(usize, 0), queue.waiting);
try std.testing.expect(queue.readers[0] == null);
try std.testing.expectEqual(@as(c_int, -1), libc.fcntl(child.file.handle, libc.F.GETFD));
- queue.cancelReader(1, 1);
- queue.acceptReader(0, gens[0]);
- queue.push(.{ .eof = .{ .pane = 0, .gen = 1 } });
- try std.testing.expect(queue.pushOutput(0, gens[0], try gpa.dupe(u8, "fresh")));
+ queue.cancelReader(.at(1), 1);
+ queue.acceptReader(.at(0), gens[0]);
+ queue.push(.{ .eof = .{ .pane = .at(0), .gen = 1 } });
+ try std.testing.expect(queue.pushOutput(.at(0), gens[0], try gpa.dupe(u8, "fresh")));
var batch = queue.take();
defer for (batch.slice()) |msg| msg.deinit(gpa, gpa);
try std.testing.expectEqual(@as(usize, 1), batch.len);
@@ -6373,7 +6387,7 @@ test "GUI PTY deletion joins an idle reader and its shell is reaped by exit" {
const rcs: host_io.Shell.PromptFiles = .{};
const child = try host_io.forkShell(null, 0, &rcs, "/bin/sh", "", 24, 80);
ptys[0] = .{ .fd = child.file.handle, .pid = child.pid, .serial = core.panes[0].?.serial };
- ptys[0].?.reader = try queue.startReader(.{ .handle = ptys[0].?.fd, .flags = .{ .nonblocking = false } }, 0, 1);
+ ptys[0].?.reader = try queue.startReader(.{ .handle = ptys[0].?.fd, .flags = .{ .nonblocking = false } }, .at(0), 1);
try core.removePane(0, null);
shell.reconcilePtys();
try std.testing.expect(queue.readers[0] == null);
@@ -6414,9 +6428,9 @@ test "GUI completion failure survives backlog and leaves the document unchanged"
const id = core.lsp_ask.wait.?.id;
var queue: Queue = .{ .io = std.testing.io, .gpa = gpa, .lsp_allocator = gpa, .lsp_id = id };
defer queue.deinit();
- queue.acceptReader(0, 1);
+ queue.acceptReader(.at(0), 1);
for (0..output_capacity) |_| queue.push(.{ .output = .{
- .pane = 0,
+ .pane = .at(0),
.gen = 1,
.bytes = try gpa.dupe(u8, "output"),
} });
@@ -6459,7 +6473,7 @@ test "GUI worker setup failures finish matching LSP and pipe requests" {
const req: host_io.Lsp.Request = .{
.id = core.lsp_ask.wait.?.id,
.kind = .status,
- .pane = @intCast(core.view().active),
+ .pane = .at(core.view().active),
.offset = 0,
.arg = "",
};
@@ -6560,7 +6574,7 @@ test "the window's function and editing keys reach a terminal as its cursor keys
.{ .modes = "", .sym = c.SDLK_UP, .sent = "\x1b[1;1:1A" },
};
for (cases) |case| {
- core.update(.{ .output = .{ .pane = 0, .bytes = case.modes } });
+ core.update(.{ .output = .{ .pane = .at(0), .bytes = case.modes } });
while (core.nextEffect()) |_| {}
keyDown(&in, case.sym, case.mod);
written.clearRetainingCapacity();
@@ -6678,7 +6692,7 @@ test "the clipboard pasted into a terminal reaches its pty as xterm pastes: brac
fn f(core_: *pardes.Pardes, out: *std.ArrayList(u8)) ![]const u8 {
out.clearRetainingCapacity();
while (core_.nextEffect()) |effect| {
- if (effect == .write and effect.write.pane == 0) try out.appendSlice(std.testing.allocator, effect.write.bytes.slice());
+ if (effect == .write and effect.write.pane.index() == 0) try out.appendSlice(std.testing.allocator, effect.write.bytes.slice());
}
return out.items;
}
@@ -6692,7 +6706,7 @@ test "the clipboard pasted into a terminal reaches its pty as xterm pastes: brac
putClipboard(gpa, "ls\x1b[201~; rm -rf ~\nx");
readClipboard(&shell);
try std.testing.expectEqualStrings("ls [201~; rm -rf ~\rx", try take(core, &sent));
- core.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?2004h" } });
+ core.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?2004h" } });
_ = try take(core, &sent);
readClipboard(&shell);
try std.testing.expectEqualStrings("\x1b[200~ls [201~; rm -rf ~\nx\x1b[201~", try take(core, &sent));
@@ -6774,7 +6788,7 @@ test "a click over codex in a terminal reaches its pty with its modifiers; Shift
fn f(core_: *pardes.Pardes, out: *std.ArrayList(u8)) ![]const u8 {
out.clearRetainingCapacity();
while (core_.nextEffect()) |effect| {
- if (effect == .write and effect.write.pane == 0) try out.appendSlice(std.testing.allocator, effect.write.bytes.slice());
+ if (effect == .write and effect.write.pane.index() == 0) try out.appendSlice(std.testing.allocator, effect.write.bytes.slice());
}
return out.items;
}
@@ -6784,7 +6798,7 @@ test "a click over codex in a terminal reaches its pty with its modifiers; Shift
const r = core.view().rects[0];
const mc: MouseCell = .{ .col = r.x + config.GUTTER + 5, .row = core.bodyTop(pane, r) + 3 };
const next: MouseCell = .{ .col = mc.col + 1, .row = mc.row };
- core.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?1049h\x1b[?1000h\x1b[?1002h\x1b[?1003h\x1b[?1006h" } });
+ core.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?1049h\x1b[?1000h\x1b[?1002h\x1b[?1003h\x1b[?1006h" } });
_ = try take(core, &sent);
in.post(.{ .mouse = pointerMouse(.none, .motion, mc, .{}) });
try std.testing.expectEqualStrings("\x1b[<35;6;4M", try take(core, &sent));
@@ -6824,7 +6838,7 @@ test "a wheel over codex in a terminal reaches its pty as the mouse reports it a
fn take(core_: *pardes.Pardes, out: *std.ArrayList(u8)) ![]const u8 {
out.clearRetainingCapacity();
while (core_.nextEffect()) |effect| {
- if (effect == .write and effect.write.pane == 0) try out.appendSlice(std.testing.allocator, effect.write.bytes.slice());
+ if (effect == .write and effect.write.pane.index() == 0) try out.appendSlice(std.testing.allocator, effect.write.bytes.slice());
}
return out.items;
}
@@ -6834,7 +6848,7 @@ test "a wheel over codex in a terminal reaches its pty as the mouse reports it a
const r = core.view().rects[0];
const mc: MouseCell = .{ .col = r.x + config.GUTTER + 5, .row = core.bodyTop(pane, r) + 3 };
// What codex 0.159's chat sets on start.
- core.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?2004h\x1b[>7u\x1b[?1004h\x1b[?1049h\x1b[?1007l\x1b[?1000h\x1b[?1002h\x1b[?1003h\x1b[?1006h" } });
+ core.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?2004h\x1b[>7u\x1b[?1004h\x1b[?1049h\x1b[?1007l\x1b[?1000h\x1b[?1002h\x1b[?1003h\x1b[?1006h" } });
pardes.draw.facts(core, &g.facts);
_ = try Sent.take(core, &sent);
// A notch up, then a fast turn of three down: each its report, none
@@ -6860,14 +6874,14 @@ test "a wheel over codex in a terminal reaches its pty as the mouse reports it a
try std.testing.expectEqualStrings("", try Sent.take(core, &sent));
resetScroll(&g);
// Its sign-in screen: mouse off, alternate scroll on, so arrow keys.
- core.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?1006l\x1b[?1003l\x1b[?1002l\x1b[?1000l\x1b[?1007h" } });
+ core.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?1006l\x1b[?1003l\x1b[?1002l\x1b[?1000l\x1b[?1007h" } });
pardes.draw.facts(core, &g.facts);
_ = try Sent.take(core, &sent);
wheelAt(&g, &in, .{ .y = -1, .integer_y = -1 }, mc);
try std.testing.expectEqualStrings("\x1b[B", try Sent.take(core, &sent));
// Back on the main screen a shell's wheel is ours: a notch to glide,
// nothing to the pty.
- core.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?1049l" } });
+ core.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?1049l" } });
pardes.draw.facts(core, &g.facts);
_ = try Sent.take(core, &sent);
wheelAt(&g, &in, .{ .y = 1, .integer_y = 1 }, mc);