aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/terminal/Selection.zig
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-10 21:51:57 +0300
committerGitHub <noreply@github.com>2026-09-10 21:51:57 +0300
commit425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch)
treee52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/terminal/Selection.zig
parent90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff)
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/Selection.zig')
-rw-r--r--vendor/libghostty-vt/src/terminal/Selection.zig46
1 files changed, 24 insertions, 22 deletions
diff --git a/vendor/libghostty-vt/src/terminal/Selection.zig b/vendor/libghostty-vt/src/terminal/Selection.zig
index be6854e5..398496da 100644
--- a/vendor/libghostty-vt/src/terminal/Selection.zig
+++ b/vendor/libghostty-vt/src/terminal/Selection.zig
@@ -512,7 +512,7 @@ pub fn adjust(
test "Selection: adjust right" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A1234\nB5678\nC1234\nD5678");
@@ -579,7 +579,7 @@ test "Selection: adjust right" {
test "Selection: adjust left" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A1234\nB5678\nC1234\nD5678");
@@ -628,7 +628,7 @@ test "Selection: adjust left" {
test "Selection: adjust left skips blanks" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A1234\nB5678\nC12\nD56");
@@ -677,7 +677,7 @@ test "Selection: adjust left skips blanks" {
test "Selection: adjust up" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A\nB\nC\nD\nE");
@@ -724,7 +724,7 @@ test "Selection: adjust up" {
test "Selection: adjust down" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A\nB\nC\nD\nE");
@@ -771,7 +771,7 @@ test "Selection: adjust down" {
test "Selection: adjust down with not full screen" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A\nB\nC");
@@ -799,7 +799,7 @@ test "Selection: adjust down with not full screen" {
test "Selection: adjust home" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A\nB\nC");
@@ -827,7 +827,7 @@ test "Selection: adjust home" {
test "Selection: adjust end with not full screen" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A\nB\nC");
@@ -855,7 +855,7 @@ test "Selection: adjust end with not full screen" {
test "Selection: adjust beginning of line" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 8, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 8, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A12 B34\nC12 D34");
@@ -925,7 +925,7 @@ test "Selection: adjust beginning of line" {
test "Selection: adjust end of line" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 8, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 8, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
try s.testWriteString("A12 B34\nC12 D34");
@@ -994,8 +994,9 @@ test "Selection: adjust end of line" {
test "Selection: order, standard" {
const testing = std.testing;
const alloc = testing.allocator;
+ const io = testing.io;
- var s = try Screen.init(alloc, .{ .cols = 100, .rows = 100, .max_scrollback = 1 });
+ var s = try Screen.init(io, alloc, .{ .cols = 100, .rows = 100, .max_scrollback_bytes = 1 });
defer s.deinit();
{
@@ -1057,10 +1058,10 @@ test "Selection: order, standard" {
test "Selection: rectangle corners clamp across mixed-width pages" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{
+ var s = try Screen.init(testing.io, testing.allocator, .{
.cols = 4,
.rows = 2,
- .max_scrollback = 0,
+ .max_scrollback_bytes = 0,
});
defer s.deinit();
@@ -1084,8 +1085,9 @@ test "Selection: rectangle corners clamp across mixed-width pages" {
test "Selection: order, rectangle" {
const testing = std.testing;
const alloc = testing.allocator;
+ const io = testing.io;
- var s = try Screen.init(alloc, .{ .cols = 100, .rows = 100, .max_scrollback = 1 });
+ var s = try Screen.init(io, alloc, .{ .cols = 100, .rows = 100, .max_scrollback_bytes = 1 });
defer s.deinit();
// Conventions:
@@ -1197,7 +1199,7 @@ test "Selection: order, rectangle" {
test "topLeft" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
{
// forward
@@ -1260,7 +1262,7 @@ test "topLeft" {
test "bottomRight" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
{
// forward
@@ -1323,7 +1325,7 @@ test "bottomRight" {
test "ordered" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
{
// forward
@@ -1404,7 +1406,7 @@ test "ordered" {
test "Selection: contains" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 10, .max_scrollback_bytes = 0 });
defer s.deinit();
{
const sel = Selection.init(
@@ -1450,7 +1452,7 @@ test "Selection: contains" {
test "Selection: contains, rectangle" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 15, .rows = 15, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 15, .rows = 15, .max_scrollback_bytes = 0 });
defer s.deinit();
{
const sel = Selection.init(
@@ -1512,7 +1514,7 @@ test "Selection: contains, rectangle" {
test "Selection: containedRow" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{ .cols = 10, .rows = 5, .max_scrollback = 0 });
+ var s = try Screen.init(testing.io, testing.allocator, .{ .cols = 10, .rows = 5, .max_scrollback_bytes = 0 });
defer s.deinit();
{
@@ -1632,10 +1634,10 @@ test "Selection: containedRow" {
test "Selection: containedRow clamps mixed-width pages" {
const testing = std.testing;
- var s = try Screen.init(testing.allocator, .{
+ var s = try Screen.init(testing.io, testing.allocator, .{
.cols = 4,
.rows = 3,
- .max_scrollback = 0,
+ .max_scrollback_bytes = 0,
});
defer s.deinit();