diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 14:43:17 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | ada81f05127506dec0dbb7af390cb43fd0da9d40 (patch) | |
| tree | 6559fe9446530528dbd62b37a4dbf9d70c331736 /src/pardes.zig | |
| parent | def16a1bc1c71d2fdcc7954e2ddec1384c2f05f7 (diff) | |
| download | pardes-ada81f05127506dec0dbb7af390cb43fd0da9d40.tar.gz pardes-ada81f05127506dec0dbb7af390cb43fd0da9d40.zip | |
A reused command pane leaves the last program's screen modes before the next command
A program that crashed out of a full screen left the command pane's emulator
in the alternate screen with mouse reports, bracketed paste or a hidden cursor
on, and the next command ran in that. Before the '% line' separator the pane
now leaves the alternate screen, turns those modes off and soft-resets
(DECSTR). The docs add that a command which clears the screen and its
scrollback erases the pane's history above it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 74554e0d..97ba534a 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1432,8 +1432,13 @@ test "a command pane shows how its command ended, and the next command there run // Kill leaves a finished one be. try std.testing.expect(p.executeBuiltinLine(0, "Kill make")); while (p.nextEffect()) |effect| if (effect == .signal_pty and effect.signal_pty.pane == dst) return error.SignalledAFinishedCommand; + // A program that crashed out of its full screen leaves the emulator + // in its modes; the next command starts clear of them. + p.update(.{ .output = .{ .pane = @intCast(dst), .bytes = "\x1b[?1049h\x1b[?2004h\x1b[?1000h" } }); + try std.testing.expect(panes.Terminal.bracketedPaste(pane)); // Done, the directory's next command runs there, below what it showed. try std.testing.expectEqual(@as(?usize, dst), exec.execute(p, 1, "make test")); + try std.testing.expect(!panes.Terminal.bracketedPaste(pane)); var respawned = false; while (p.nextEffect()) |effect| if (effect == .spawn and effect.spawn.pane == dst) { respawned = true; |
