mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
enable/disable autowrap
This commit is contained in:
@ -748,6 +748,10 @@ pub fn setMode(self: *Window, mode: terminal.Mode, enabled: bool) !void {
|
||||
self.terminal.setCursorPos(1, 1);
|
||||
},
|
||||
|
||||
.autowrap => {
|
||||
self.terminal.mode_autowrap = enabled;
|
||||
},
|
||||
|
||||
.bracketed_paste => self.bracketed_paste = true,
|
||||
|
||||
else => if (enabled) log.warn("unimplemented mode: {}", .{mode}),
|
||||
|
@ -44,6 +44,7 @@ scrolling_region: ScrollingRegion,
|
||||
/// Modes
|
||||
// TODO: turn into a bitset probably
|
||||
mode_origin: bool = false,
|
||||
mode_autowrap: bool = true,
|
||||
mode_reverse_colors: bool = false,
|
||||
|
||||
/// Scrolling region is the area of the screen designated where scrolling
|
||||
@ -202,7 +203,7 @@ pub fn print(self: *Terminal, c: u21) !void {
|
||||
defer tracy.end();
|
||||
|
||||
// If we're soft-wrapping, then handle that first.
|
||||
if (self.cursor.pending_wrap) {
|
||||
if (self.cursor.pending_wrap and self.mode_autowrap) {
|
||||
// Mark that the cell is wrapped, which guarantees that there is
|
||||
// at least one cell after it in the next row.
|
||||
const cell = self.screen.getCell(self.cursor.y, self.cursor.x);
|
||||
|
@ -50,6 +50,9 @@ pub const Mode = enum(u16) {
|
||||
/// the current scroll region.
|
||||
origin = 6,
|
||||
|
||||
/// Enable or disable automatic line wrapping.
|
||||
autowrap = 7,
|
||||
|
||||
/// Bracket clipboard paste contents in delimiter sequences.
|
||||
///
|
||||
/// When pasting from the (e.g. system) clipboard add "ESC [ 2 0 0 ~"
|
||||
|
Reference in New Issue
Block a user