summaryrefslogtreecommitdiff
path: root/src/Term.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Term.zig')
-rw-r--r--src/Term.zig29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Term.zig b/src/Term.zig
index ba0a2307..160ed01e 100644
--- a/src/Term.zig
+++ b/src/Term.zig
@@ -166,3 +166,32 @@ pub const CommandOutput = struct {
/// it ran, or never marked (a C or D on the alternate screen).
whole: bool,
};
+
+// ---- text ----
+
+/// Its whole scrollback as plain text, logical lines (rows it wrapped
+/// joined again), ending in a newline: what its body reads and Save
+/// writes. The caller's.
+pub const scrollback = terminal.scrollback;
+/// How long `scrollback` would be, counted without keeping it.
+pub const scrollbackLen = terminal.scrollbackLen;
+/// Its rows from the top of its history as text, a prompt's own cells cut
+/// off (`Rows`).
+pub const textRows = terminal.textRows;
+/// The rows its view shows as text, prompts cut off or not.
+pub const viewport = terminal.viewport;
+/// How many bytes of one of its rows, as `viewport` and `textRows` give it
+/// uncut, are the prompt it starts with.
+pub const promptPrefix = terminal.promptPrefix;
+/// A step read its rows: its replicas must hold them for the step's
+/// replay.
+pub const markRead = terminal.markRead;
+
+/// A terminal's rows as text: `rows` slices into `text`, which is a prefix
+/// of `text_alloc` (a prompt cut off shortens the join), the last row the
+/// empty one after the cursor's.
+pub const Rows = struct {
+ text_alloc: []u8,
+ text: []const u8,
+ rows: [][]const u8,
+};