From 5f77b0ed98658c279e0fa37e8a500e7663afd9ce Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 26 Jan 2026 13:26:33 -0800 Subject: [PATCH] terminal: remove old semantic_prompt --- src/renderer/row.zig | 6 +++--- src/terminal/page.zig | 31 ++----------------------------- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/src/renderer/row.zig b/src/renderer/row.zig index 933bb338b..38b8540f9 100644 --- a/src/renderer/row.zig +++ b/src/renderer/row.zig @@ -15,9 +15,9 @@ pub fn neverExtendBg( // Any semantic prompts should not have their background extended // because prompts often contain special formatting (such as // powerline) that looks bad when extended. - switch (row.semantic_prompt) { - .prompt, .prompt_continuation, .input => return true, - .unknown, .command => {}, + switch (row.semantic_prompt2) { + .prompt, .prompt_continuation => return true, + .no_prompt => {}, } for (0.., cells) |x, *cell| { diff --git a/src/terminal/page.zig b/src/terminal/page.zig index 3747a8e6a..31879aaf4 100644 --- a/src/terminal/page.zig +++ b/src/terminal/page.zig @@ -1898,10 +1898,6 @@ pub const Row = packed struct(u64) { /// false negatives. This is used to optimize hyperlink operations. hyperlink: bool = false, - /// The semantic prompt type for this row as specified by the - /// running program, or "unknown" if it was never set. - semantic_prompt: SemanticPrompt = .unknown, - /// The semantic prompt state for this row. /// /// This is ONLY meant to note if there are ANY cells in this @@ -1933,9 +1929,9 @@ pub const Row = packed struct(u64) { /// screen. dirty: bool = false, - _padding: u20 = 0, + _padding: u23 = 0, - /// The semantic prompt state of the row. See `semantic_prompt`. + /// The semantic prompt state of the row. See `semantic_prompt2`. pub const SemanticPrompt2 = enum(u2) { /// No prompt cells in this row. no_prompt = 0, @@ -1946,29 +1942,6 @@ pub const Row = packed struct(u64) { prompt_continuation = 2, }; - /// Semantic prompt type. - pub const SemanticPrompt = enum(u3) { - /// Unknown, the running application didn't tell us for this line. - unknown = 0, - - /// This is a prompt line, meaning it only contains the shell prompt. - /// For poorly behaving shells, this may also be the input. - prompt = 1, - prompt_continuation = 2, - - /// This line contains the input area. We don't currently track - /// where this actually is in the line, so we just assume it is somewhere. - input = 3, - - /// This line is the start of command output. - command = 4, - - /// True if this is a prompt or input line. - pub fn promptOrInput(self: SemanticPrompt) bool { - return self == .prompt or self == .prompt_continuation or self == .input; - } - }; - /// Returns true if this row has any managed memory outside of the /// row structure (graphemes, styles, etc.) pub inline fn managedMemory(self: Row) bool {