mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-03 12:48:44 +03:00
terminal: introduce testWriteSemanticString
This test-only function wraps testWriteString with semantic prompt marking. This replaces the manual, row-based semantic_prompt field manipulation we were doing in all of our prompt-related test setups. This function's heuristics are a little complex because it wraps testWriteString as a "black box"; we don't benefit from that function's own line-based logic to know which rows need to be updated with the semantic prompt flag. We need to infer them externally instead. I considered adding an options argument to testWriteString that would allow passing e.g. a semantic_prompt prompt. Given that it's called from 200+ places, that would involve a lot of unrelated changes, but it remains an "option" (ha!) if there's value there for other cases. I also have plans that move us from row-based to cell-based semantic tracking, where the current semantic type is tracked by the cursor. In that implementation, testWriteString can update the written cells directly, and testWriteSemanticString just helps manage the cursor's state. Introducing testWriteSemanticString here and now therefore helps bridge us to that world while maintaining test consistency.
This commit is contained in:
@ -3068,6 +3068,29 @@ pub fn testWriteString(self: *Screen, text: []const u8) !void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Write text that's marked as a semantic prompt.
|
||||||
|
fn testWriteSemanticString(self: *Screen, text: []const u8, semantic_prompt: Row.SemanticPrompt) !void {
|
||||||
|
// Determine the first row using the cursor position. If we know that our
|
||||||
|
// first write is going to start on the next line because of a pending
|
||||||
|
// wrap, we'll proactively start there.
|
||||||
|
const start_y = if (self.cursor.pending_wrap) self.cursor.y + 1 else self.cursor.y;
|
||||||
|
|
||||||
|
try self.testWriteString(text);
|
||||||
|
|
||||||
|
// Determine the last row that we actually wrote by inspecting the cursor's
|
||||||
|
// position. If we're in the first column, we haven't actually written any
|
||||||
|
// characters to it, so we end at the preceding row instead.
|
||||||
|
const end_y = if (self.cursor.x > 0) self.cursor.y else self.cursor.y - 1;
|
||||||
|
|
||||||
|
// Mark the full range of written rows with our semantic prompt.
|
||||||
|
var y = start_y;
|
||||||
|
while (y <= end_y) {
|
||||||
|
const pin = self.pages.pin(.{ .active = .{ .y = y } }).?;
|
||||||
|
pin.rowAndCell().row.semantic_prompt = semantic_prompt;
|
||||||
|
y += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test "Screen read and write" {
|
test "Screen read and write" {
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
@ -3686,16 +3709,11 @@ test "Screen: clearPrompt" {
|
|||||||
|
|
||||||
var s = try init(alloc, 5, 3, 0);
|
var s = try init(alloc, 5, 3, 0);
|
||||||
defer s.deinit();
|
defer s.deinit();
|
||||||
const str = "1ABCD\n2EFGH\n3IJKL";
|
|
||||||
try s.testWriteString(str);
|
|
||||||
|
|
||||||
// Set one of the rows to be a prompt
|
// Set one of the rows to be a prompt
|
||||||
{
|
try s.testWriteSemanticString("1ABCD\n", .unknown);
|
||||||
s.cursorAbsolute(0, 1);
|
try s.testWriteSemanticString("2EFGH\n", .prompt);
|
||||||
s.cursor.page_row.semantic_prompt = .prompt;
|
try s.testWriteSemanticString("3IJKL", .input);
|
||||||
s.cursorAbsolute(0, 2);
|
|
||||||
s.cursor.page_row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
|
|
||||||
s.clearPrompt();
|
s.clearPrompt();
|
||||||
|
|
||||||
@ -3712,18 +3730,12 @@ test "Screen: clearPrompt continuation" {
|
|||||||
|
|
||||||
var s = try init(alloc, 5, 4, 0);
|
var s = try init(alloc, 5, 4, 0);
|
||||||
defer s.deinit();
|
defer s.deinit();
|
||||||
const str = "1ABCD\n2EFGH\n3IJKL\n4MNOP";
|
|
||||||
try s.testWriteString(str);
|
|
||||||
|
|
||||||
// Set one of the rows to be a prompt followed by a continuation row
|
// Set one of the rows to be a prompt followed by a continuation row
|
||||||
{
|
try s.testWriteSemanticString("1ABCD\n", .unknown);
|
||||||
s.cursorAbsolute(0, 1);
|
try s.testWriteSemanticString("2EFGH\n", .prompt);
|
||||||
s.cursor.page_row.semantic_prompt = .prompt;
|
try s.testWriteSemanticString("3IJKL\n", .prompt_continuation);
|
||||||
s.cursorAbsolute(0, 2);
|
try s.testWriteSemanticString("4MNOP", .input);
|
||||||
s.cursor.page_row.semantic_prompt = .prompt_continuation;
|
|
||||||
s.cursorAbsolute(0, 3);
|
|
||||||
s.cursor.page_row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
|
|
||||||
s.clearPrompt();
|
s.clearPrompt();
|
||||||
|
|
||||||
@ -3734,22 +3746,17 @@ test "Screen: clearPrompt continuation" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test "Screen: clearPrompt consecutive prompts" {
|
test "Screen: clearPrompt consecutive inputs" {
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
|
|
||||||
var s = try init(alloc, 5, 3, 0);
|
var s = try init(alloc, 5, 3, 0);
|
||||||
defer s.deinit();
|
defer s.deinit();
|
||||||
const str = "1ABCD\n2EFGH\n3IJKL";
|
|
||||||
try s.testWriteString(str);
|
|
||||||
|
|
||||||
// Set both rows to be prompts
|
// Set both rows to be inputs
|
||||||
{
|
try s.testWriteSemanticString("1ABCD\n", .unknown);
|
||||||
s.cursorAbsolute(0, 1);
|
try s.testWriteSemanticString("2EFGH\n", .input);
|
||||||
s.cursor.page_row.semantic_prompt = .input;
|
try s.testWriteSemanticString("3IJKL", .input);
|
||||||
s.cursorAbsolute(0, 2);
|
|
||||||
s.cursor.page_row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
|
|
||||||
s.clearPrompt();
|
s.clearPrompt();
|
||||||
|
|
||||||
@ -6057,26 +6064,24 @@ test "Screen: resize more cols no reflow preserves semantic prompt" {
|
|||||||
|
|
||||||
var s = try init(alloc, 5, 3, 0);
|
var s = try init(alloc, 5, 3, 0);
|
||||||
defer s.deinit();
|
defer s.deinit();
|
||||||
const str = "1ABCD\n2EFGH\n3IJKL";
|
|
||||||
try s.testWriteString(str);
|
|
||||||
|
|
||||||
// Set one of the rows to be a prompt
|
// Set one of the rows to be a prompt
|
||||||
{
|
try s.testWriteSemanticString("1ABCD\n", .unknown);
|
||||||
s.cursorAbsolute(0, 1);
|
try s.testWriteSemanticString("2EFGH\n", .prompt);
|
||||||
s.cursor.page_row.semantic_prompt = .prompt;
|
try s.testWriteSemanticString("3IJKL", .unknown);
|
||||||
}
|
|
||||||
|
|
||||||
try s.resize(10, 3);
|
try s.resize(10, 3);
|
||||||
|
|
||||||
|
const expected = "1ABCD\n2EFGH\n3IJKL";
|
||||||
{
|
{
|
||||||
const contents = try s.dumpStringAlloc(alloc, .{ .viewport = .{} });
|
const contents = try s.dumpStringAlloc(alloc, .{ .viewport = .{} });
|
||||||
defer alloc.free(contents);
|
defer alloc.free(contents);
|
||||||
try testing.expectEqualStrings(str, contents);
|
try testing.expectEqualStrings(expected, contents);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const contents = try s.dumpStringAlloc(alloc, .{ .screen = .{} });
|
const contents = try s.dumpStringAlloc(alloc, .{ .screen = .{} });
|
||||||
defer alloc.free(contents);
|
defer alloc.free(contents);
|
||||||
try testing.expectEqualStrings(str, contents);
|
try testing.expectEqualStrings(expected, contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Our one row should still be a semantic prompt, the others should not.
|
// Our one row should still be a semantic prompt, the others should not.
|
||||||
@ -7507,7 +7512,9 @@ test "Screen: selectLine semantic prompt boundary" {
|
|||||||
|
|
||||||
var s = try init(alloc, 5, 10, 0);
|
var s = try init(alloc, 5, 10, 0);
|
||||||
defer s.deinit();
|
defer s.deinit();
|
||||||
try s.testWriteString("ABCDE\nA > ");
|
try s.testWriteSemanticString("ABCDE\n", .unknown);
|
||||||
|
try s.testWriteSemanticString("A ", .prompt);
|
||||||
|
try s.testWriteSemanticString("> ", .unknown);
|
||||||
|
|
||||||
{
|
{
|
||||||
const contents = try s.dumpStringAlloc(alloc, .{ .screen = .{} });
|
const contents = try s.dumpStringAlloc(alloc, .{ .screen = .{} });
|
||||||
@ -7515,12 +7522,6 @@ test "Screen: selectLine semantic prompt boundary" {
|
|||||||
try testing.expectEqualStrings("ABCDE\nA \n> ", contents);
|
try testing.expectEqualStrings("ABCDE\nA \n> ", contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 1 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .prompt;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Selecting output stops at the prompt even if soft-wrapped
|
// Selecting output stops at the prompt even if soft-wrapped
|
||||||
{
|
{
|
||||||
var sel = s.selectLine(.{ .pin = s.pages.pin(.{ .active = .{
|
var sel = s.selectLine(.{ .pin = s.pages.pin(.{ .active = .{
|
||||||
@ -7905,55 +7906,23 @@ test "Screen: selectOutput" {
|
|||||||
// zig fmt: off
|
// zig fmt: off
|
||||||
{
|
{
|
||||||
// line number:
|
// line number:
|
||||||
try s.testWriteString("output1\n"); // 0
|
try s.testWriteSemanticString("output1\n", .command); // 0
|
||||||
try s.testWriteString("output1\n"); // 1
|
try s.testWriteSemanticString("output1\n", .command); // 1
|
||||||
try s.testWriteString("prompt2\n"); // 2
|
try s.testWriteSemanticString("prompt2\n", .prompt); // 2
|
||||||
try s.testWriteString("input2\n"); // 3
|
try s.testWriteSemanticString("input2\n", .input); // 3
|
||||||
try s.testWriteString("output2output2output2output2\n"); // 4, 5, 6 due to overflow
|
try s.testWriteSemanticString( //
|
||||||
try s.testWriteString("output2\n"); // 7
|
"output2output2output2output2\n", // 4, 5, 6 due to overflow
|
||||||
try s.testWriteString("$ input3\n"); // 8
|
.command, //
|
||||||
try s.testWriteString("output3\n"); // 9
|
); //
|
||||||
try s.testWriteString("output3\n"); // 10
|
try s.testWriteSemanticString("output2\n", .command); // 7
|
||||||
try s.testWriteString("output3"); // 11
|
try s.testWriteSemanticString("$ ", .prompt); // 8 prompt
|
||||||
|
try s.testWriteSemanticString("input3\n", .input); // 8 input
|
||||||
|
try s.testWriteSemanticString("output3\n", .command); // 9
|
||||||
|
try s.testWriteSemanticString("output3\n", .command); // 10
|
||||||
|
try s.testWriteSemanticString("output3", .command); // 11
|
||||||
}
|
}
|
||||||
// zig fmt: on
|
// zig fmt: on
|
||||||
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 2 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .prompt;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 3 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 4 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 5 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 6 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 8 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 9 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
|
|
||||||
// No start marker, should select from the beginning
|
// No start marker, should select from the beginning
|
||||||
{
|
{
|
||||||
var sel = s.selectOutput(s.pages.pin(.{ .active = .{
|
var sel = s.selectOutput(s.pages.pin(.{ .active = .{
|
||||||
@ -8006,19 +7975,10 @@ test "Screen: selectOutput" {
|
|||||||
{
|
{
|
||||||
s.deinit();
|
s.deinit();
|
||||||
s = try init(alloc, 10, 5, 0);
|
s = try init(alloc, 10, 5, 0);
|
||||||
try s.testWriteString("$ input1\n");
|
try s.testWriteSemanticString("$ ", .prompt);
|
||||||
try s.testWriteString("output1\n");
|
try s.testWriteSemanticString("input1\n", .input);
|
||||||
try s.testWriteString("prompt2\n");
|
try s.testWriteSemanticString("output1\n", .command);
|
||||||
{
|
try s.testWriteSemanticString("prompt2\n", .prompt);
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 0 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 1 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
try testing.expect(s.selectOutput(s.pages.pin(.{ .active = .{
|
try testing.expect(s.selectOutput(s.pages.pin(.{ .active = .{
|
||||||
.x = 2,
|
.x = 2,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
@ -8035,46 +7995,21 @@ test "Screen: selectPrompt basics" {
|
|||||||
|
|
||||||
// zig fmt: off
|
// zig fmt: off
|
||||||
{
|
{
|
||||||
// line number:
|
// line number:
|
||||||
try s.testWriteString("output1\n"); // 0
|
try s.testWriteSemanticString("output1\n", .command); // 0
|
||||||
try s.testWriteString("output1\n"); // 1
|
try s.testWriteSemanticString("output1\n", .command); // 1
|
||||||
try s.testWriteString("prompt2\n"); // 2
|
try s.testWriteSemanticString("prompt2\n", .prompt); // 2
|
||||||
try s.testWriteString("input2\n"); // 3
|
try s.testWriteSemanticString("input2\n", .input); // 3
|
||||||
try s.testWriteString("output2\n"); // 4
|
try s.testWriteSemanticString("output2\n", .command); // 4
|
||||||
try s.testWriteString("output2\n"); // 5
|
try s.testWriteSemanticString("output2\n", .command); // 5
|
||||||
try s.testWriteString("$ input3\n"); // 6
|
try s.testWriteSemanticString("$ ", .prompt); // 6 prompt
|
||||||
try s.testWriteString("output3\n"); // 7
|
try s.testWriteSemanticString("input3\n", .input); // 6 input
|
||||||
try s.testWriteString("output3\n"); // 8
|
try s.testWriteSemanticString("output3\n", .command); // 7
|
||||||
try s.testWriteString("output3"); // 9
|
try s.testWriteSemanticString("output3\n", .command); // 8
|
||||||
|
try s.testWriteSemanticString("output3", .command); // 9
|
||||||
}
|
}
|
||||||
// zig fmt: on
|
// zig fmt: on
|
||||||
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 2 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .prompt;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 3 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 4 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 6 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 7 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not at a prompt
|
// Not at a prompt
|
||||||
{
|
{
|
||||||
const sel = s.selectPrompt(s.pages.pin(.{ .active = .{
|
const sel = s.selectPrompt(s.pages.pin(.{ .active = .{
|
||||||
@ -8135,30 +8070,14 @@ test "Screen: selectPrompt prompt at start" {
|
|||||||
|
|
||||||
// zig fmt: off
|
// zig fmt: off
|
||||||
{
|
{
|
||||||
// line number:
|
// line number:
|
||||||
try s.testWriteString("prompt1\n"); // 0
|
try s.testWriteSemanticString("prompt1\n", .prompt); // 0
|
||||||
try s.testWriteString("input1\n"); // 1
|
try s.testWriteSemanticString("input1\n", .input); // 1
|
||||||
try s.testWriteString("output2\n"); // 2
|
try s.testWriteSemanticString("output2\n", .command); // 2
|
||||||
try s.testWriteString("output2\n"); // 3
|
try s.testWriteSemanticString("output2\n", .command); // 3
|
||||||
}
|
}
|
||||||
// zig fmt: on
|
// zig fmt: on
|
||||||
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 0 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .prompt;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 1 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 2 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not at a prompt
|
// Not at a prompt
|
||||||
{
|
{
|
||||||
const sel = s.selectPrompt(s.pages.pin(.{ .active = .{
|
const sel = s.selectPrompt(s.pages.pin(.{ .active = .{
|
||||||
@ -8195,25 +8114,14 @@ test "Screen: selectPrompt prompt at end" {
|
|||||||
|
|
||||||
// zig fmt: off
|
// zig fmt: off
|
||||||
{
|
{
|
||||||
// line number:
|
// line number:
|
||||||
try s.testWriteString("output2\n"); // 0
|
try s.testWriteSemanticString("output2\n", .command); // 0
|
||||||
try s.testWriteString("output2\n"); // 1
|
try s.testWriteSemanticString("output2\n", .command); // 1
|
||||||
try s.testWriteString("prompt1\n"); // 2
|
try s.testWriteSemanticString("prompt1\n", .prompt); // 2
|
||||||
try s.testWriteString("input1\n"); // 3
|
try s.testWriteSemanticString("input1\n", .input); // 3
|
||||||
}
|
}
|
||||||
// zig fmt: on
|
// zig fmt: on
|
||||||
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 2 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .prompt;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 3 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not at a prompt
|
// Not at a prompt
|
||||||
{
|
{
|
||||||
const sel = s.selectPrompt(s.pages.pin(.{ .active = .{
|
const sel = s.selectPrompt(s.pages.pin(.{ .active = .{
|
||||||
@ -8250,46 +8158,21 @@ test "Screen: promptPath" {
|
|||||||
|
|
||||||
// zig fmt: off
|
// zig fmt: off
|
||||||
{
|
{
|
||||||
// line number:
|
// line number:
|
||||||
try s.testWriteString("output1\n"); // 0
|
try s.testWriteSemanticString("output1\n", .command); // 0
|
||||||
try s.testWriteString("output1\n"); // 1
|
try s.testWriteSemanticString("output1\n", .command); // 1
|
||||||
try s.testWriteString("prompt2\n"); // 2
|
try s.testWriteSemanticString("prompt2\n", .prompt); // 2
|
||||||
try s.testWriteString("input2\n"); // 3
|
try s.testWriteSemanticString("input2\n", .input); // 3
|
||||||
try s.testWriteString("output2\n"); // 4
|
try s.testWriteSemanticString("output2\n", .command); // 4
|
||||||
try s.testWriteString("output2\n"); // 5
|
try s.testWriteSemanticString("output2\n", .command); // 5
|
||||||
try s.testWriteString("$ input3\n"); // 6
|
try s.testWriteSemanticString("$ ", .prompt); // 6 prompt
|
||||||
try s.testWriteString("output3\n"); // 7
|
try s.testWriteSemanticString("input3\n", .input); // 6 input
|
||||||
try s.testWriteString("output3\n"); // 8
|
try s.testWriteSemanticString("output3\n", .command); // 7
|
||||||
try s.testWriteString("output3"); // 9
|
try s.testWriteSemanticString("output3\n", .command); // 8
|
||||||
|
try s.testWriteSemanticString("output3", .command); // 9
|
||||||
}
|
}
|
||||||
// zig fmt: on
|
// zig fmt: on
|
||||||
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 2 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .prompt;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 3 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 4 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 6 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .input;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const pin = s.pages.pin(.{ .screen = .{ .y = 7 } }).?;
|
|
||||||
const row = pin.rowAndCell().row;
|
|
||||||
row.semantic_prompt = .command;
|
|
||||||
}
|
|
||||||
|
|
||||||
// From is not in the prompt
|
// From is not in the prompt
|
||||||
{
|
{
|
||||||
const path = s.promptPath(
|
const path = s.promptPath(
|
||||||
|
Reference in New Issue
Block a user