mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
terminal: ECH resets line wrap state in any scenario
This commit is contained in:
@ -1497,6 +1497,9 @@ pub fn eraseChars(self: *Terminal, count_req: usize) void {
|
|||||||
break :end end;
|
break :end end;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This resets the soft-wrap of this line
|
||||||
|
row.setWrapped(false);
|
||||||
|
|
||||||
const pen: Screen.Cell = .{
|
const pen: Screen.Cell = .{
|
||||||
.bg = self.screen.cursor.pen.bg,
|
.bg = self.screen.cursor.pen.bg,
|
||||||
};
|
};
|
||||||
@ -4838,7 +4841,7 @@ test "Terminal: deleteChars split wide character tail" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test "Terminal: eraseChars resets wrap" {
|
test "Terminal: eraseChars resets pending wrap" {
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
var t = try init(alloc, 5, 5);
|
var t = try init(alloc, 5, 5);
|
||||||
defer t.deinit(alloc);
|
defer t.deinit(alloc);
|
||||||
@ -4856,6 +4859,33 @@ test "Terminal: eraseChars resets wrap" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "Terminal: eraseChars resets wrap" {
|
||||||
|
const alloc = testing.allocator;
|
||||||
|
var t = try init(alloc, 5, 5);
|
||||||
|
defer t.deinit(alloc);
|
||||||
|
|
||||||
|
for ("ABCDE123") |c| try t.print(c);
|
||||||
|
{
|
||||||
|
const row = t.screen.getRow(.{ .active = 0 });
|
||||||
|
try testing.expect(row.isWrapped());
|
||||||
|
}
|
||||||
|
|
||||||
|
t.setCursorPos(1, 1);
|
||||||
|
t.eraseChars(1);
|
||||||
|
|
||||||
|
{
|
||||||
|
const row = t.screen.getRow(.{ .active = 0 });
|
||||||
|
try testing.expect(!row.isWrapped());
|
||||||
|
}
|
||||||
|
try t.print('X');
|
||||||
|
|
||||||
|
{
|
||||||
|
const str = try t.plainString(testing.allocator);
|
||||||
|
defer testing.allocator.free(str);
|
||||||
|
try testing.expectEqualStrings("XBCDE\n123", str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test "Terminal: eraseChars simple operation" {
|
test "Terminal: eraseChars simple operation" {
|
||||||
const alloc = testing.allocator;
|
const alloc = testing.allocator;
|
||||||
var t = try init(alloc, 5, 5);
|
var t = try init(alloc, 5, 5);
|
||||||
|
@ -12,7 +12,8 @@ or equal to 0, adjust `n` to be 1. If `n` is omitted, `n` defaults to 1.
|
|||||||
The rightmost column that can be erased is the rightmost column of the screen.
|
The rightmost column that can be erased is the rightmost column of the screen.
|
||||||
The [right margin](#) has no effect on this sequence.
|
The [right margin](#) has no effect on this sequence.
|
||||||
|
|
||||||
This sequence always unsets the pending wrap state.
|
This sequence always unsets the pending wrap state. If the row under the cursor
|
||||||
|
is soft-wrapped, then the soft-wrap state is also reset.
|
||||||
|
|
||||||
For `n` cells up to the rightmost column, blank the cell by replacing it
|
For `n` cells up to the rightmost column, blank the cell by replacing it
|
||||||
with an empty character with the background color colored according to the
|
with an empty character with the background color colored according to the
|
||||||
|
Reference in New Issue
Block a user