diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-22 20:21:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-22 20:21:32 -0300 |
| commit | 3f250d0f963f375d699f11ffc02b07f2e2cbbbee (patch) | |
| tree | 4e5a1f577fd3dd247f3643d979868347524ce703 /core/keys.zig | |
| parent | 34e2d82a322bd3767a8ec62b3a4c0894399e8c04 (diff) | |
| parent | c607dc14502a6956bdfa3575bc7363514a7abeb4 (diff) | |
| download | pardes-3f250d0f963f375d699f11ffc02b07f2e2cbbbee.tar.gz pardes-3f250d0f963f375d699f11ffc02b07f2e2cbbbee.zip | |
integration (a base for the terminals' next round, not yet the gathered line): the viewport in the view and the patches in the semantics hash on merge58 with the terminal put back: pardes-raw-tty (`muwnrqro`, on pardes-merge58: a TERM that reaches a session while it leaves its terminal no longer leaves it raw: `Killed.disarm` puts the cooked modes back itself, `leave` calls it last) and pardes-term-join-10's two changes (`xktusoyq` on `qtxssxyk`, on pardes-term-join-9: where a view stands in a terminal's history is the view's (`Pane.scrolled_to`), carried once a confirmed write that moves rows, the wire at 31; build/patches hashed into a replica's semantics); no conflict; core-test 917/1077 (160 skipped), shell-test 1119/1122, pane-test 182/183, term-test 16/16; NOT gated whole: the viewport's gate had one perf count over its budget ("terminal on all" +0.235%), which the next round brings down before this is the gathered line (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/keys.zig')
| -rw-r--r-- | core/keys.zig | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/keys.zig b/core/keys.zig index 8bfe8315..91cb2724 100644 --- a/core/keys.zig +++ b/core/keys.zig @@ -58,8 +58,7 @@ pub fn enterTty(p: *Pardes, id: usize) void { const pane = p.panes[id] orelse return; const selected = pane.rawPointerText(pane.sel[@backingInt(config.select_button)]) != null; if (!selected and pane.body.cur_pinned) if (pane.terminal) |state| { - const row = pane.gridRow(pane.body.cur_row) - @as(i32, @intCast(panes.Term.grid(state).offset)); - if (panes.Term.promptMoves(state, row, pane.body.cur_col)) |moves| { + if (panes.Term.promptMoves(state, pane.gridRow(pane.body.cur_row), pane.body.cur_col)) |moves| { for (0..moves.left) |_| p.emitWrite(id, "\x1b[D"); for (0..moves.right) |_| p.emitWrite(id, "\x1b[C"); } @@ -546,7 +545,7 @@ test "Esc back into a tty leaves its view at the prompt" { p.update(.{ .output = .{ .pane = .at(shell), .bytes = std.fmt.bufPrint(&buf, "line {d}\r\n", .{i}) catch unreachable } }); } p.sync(); - const live = pardes.Term.grid(sp.terminal).offset; + const live = sp.termTop(); try std.testing.expect(live > 0); p.update(.{ .key = .{ .cp = Key.escape } }); // shell-prompt heuristic: out to the doc @@ -555,7 +554,7 @@ test "Esc back into a tty leaves its view at the prompt" { p.sync(); try std.testing.expectEqual(shell, p.view().active); - try std.testing.expectEqual(live, pardes.Term.grid(sp.terminal).offset); + try std.testing.expectEqual(live, sp.termTop()); } test "Del from a key asks which neighbour takes the rows; nothing else asks" { @@ -805,7 +804,7 @@ test "raw tty forwards Ctrl letters and former global shortcuts to the child" { } p.update(.{ .key = .{ .cp = Key.up } }); try std.testing.expectEqualStrings("\x1b[A", test_api.ptyBytes(p, null, &buf)); - _ = pardes.Term.feed(p.panes[0].?.terminal.?, "\x1b[?1h", &.{}, &.{}, &.{}); // DECCKM + _ = pardes.Term.feed(p.panes[0].?.terminal.?, "\x1b[?1h", &.{}, &.{}, &.{}, &.{}); // DECCKM p.update(.{ .key = .{ .cp = Key.up } }); try std.testing.expectEqualStrings("\x1bOA", test_api.ptyBytes(p, null, &buf)); p.update(.{ .key = .{ .cp = Key.left, .ctrl = true } }); |
