summaryrefslogtreecommitdiff
path: root/src/terminal.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal.zig')
-rw-r--r--src/terminal.zig25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/terminal.zig b/src/terminal.zig
index 68b3adde..4ee2e9fa 100644
--- a/src/terminal.zig
+++ b/src/terminal.zig
@@ -16,7 +16,9 @@ const File = panes.File;
const ghostty_vt = @import("ghostty-vt");
-pub const history_max = 64;
+const EditBuffer = panes.Text.EditBuffer;
+const Snapshot = panes.Text.Snapshot;
+const history_max = panes.Text.history_max;
pub const VtSlot = ghostty_vt.Terminal;
/// A cell of an emulator's pages, as `getCell` reads it (src/echo.zig).
@@ -416,23 +418,6 @@ fn asGhostRgb(rgb: [3]u8) GColor.RGB {
return .{ .r = rgb[0], .g = rgb[1], .b = rgb[2] };
}
-/// The owned text standing in for `rows` live terminal rows, beginning at
-/// absolute surface row `row`. The emulator grid remains untouched underneath.
-pub const EditBuffer = struct {
- row: i32 = 0,
- rows: i32 = 1,
- text: []u8 = &.{},
-};
-
-/// One whole-state terminal edit boundary. Null means the pane has not yet
-/// materialized an edit buffer; non-null snapshots own their text.
-pub const Snapshot = struct {
- ovl: ?EditBuffer,
- cur_row: i32,
- cur_col: i32,
- vsel: panes.Text.CharSel,
-};
-
pub const PendingCommand = struct {
bytes: []u8 = &.{},
wait: enum { none, spawn, input } = .none,
@@ -3420,3 +3405,7 @@ test "a program asking the cell size in pixels (CSI 16 t) is told the shell's" {
p.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[16t" } });
try std.testing.expectEqualStrings("0:\x1b[6;20;10t\n", try ptyWritesByPane(p, &out));
}
+
+test "colors.xterm is the palette the emulator starts from, all 256" {
+ for (pardes.colors.xterm, ghostty_vt.color.default) |ours, its| try std.testing.expectEqual(ours, [3]u8{ its.r, its.g, its.b });
+}