mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
hook up setMode
This commit is contained in:
@ -564,3 +564,15 @@ pub fn eraseChars(self: *Window, count: usize) !void {
|
|||||||
pub fn reverseIndex(self: *Window) !void {
|
pub fn reverseIndex(self: *Window) !void {
|
||||||
try self.terminal.reverseIndex(self.alloc);
|
try self.terminal.reverseIndex(self.alloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn setMode(self: *Window, mode: terminal.Mode, enabled: bool) !void {
|
||||||
|
switch (mode) {
|
||||||
|
.origin => {
|
||||||
|
self.terminal.mode_origin = enabled;
|
||||||
|
self.terminal.setCursorPos(1, 1);
|
||||||
|
unreachable; // TODO: implement
|
||||||
|
},
|
||||||
|
|
||||||
|
else => if (enabled) log.warn("unimplemented mode: {}", .{mode}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -31,6 +31,10 @@ cols: usize,
|
|||||||
/// The current scrolling region.
|
/// The current scrolling region.
|
||||||
scrolling_region: ScrollingRegion,
|
scrolling_region: ScrollingRegion,
|
||||||
|
|
||||||
|
/// Modes
|
||||||
|
// TODO: turn into a bitset probably
|
||||||
|
mode_origin: bool = false,
|
||||||
|
|
||||||
/// Screen represents a presentable terminal screen made up of lines and cells.
|
/// Screen represents a presentable terminal screen made up of lines and cells.
|
||||||
const Screen = std.ArrayListUnmanaged(Line);
|
const Screen = std.ArrayListUnmanaged(Line);
|
||||||
const Line = std.ArrayListUnmanaged(Cell);
|
const Line = std.ArrayListUnmanaged(Cell);
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
const stream = @import("stream.zig");
|
const stream = @import("stream.zig");
|
||||||
|
const ansi = @import("ansi.zig");
|
||||||
const csi = @import("csi.zig");
|
const csi = @import("csi.zig");
|
||||||
|
|
||||||
pub const Terminal = @import("Terminal.zig");
|
pub const Terminal = @import("Terminal.zig");
|
||||||
pub const Parser = @import("Parser.zig");
|
pub const Parser = @import("Parser.zig");
|
||||||
pub const Stream = stream.Stream;
|
pub const Stream = stream.Stream;
|
||||||
|
pub const Mode = ansi.Mode;
|
||||||
pub const EraseDisplay = csi.EraseDisplay;
|
pub const EraseDisplay = csi.EraseDisplay;
|
||||||
pub const EraseLine = csi.EraseLine;
|
pub const EraseLine = csi.EraseLine;
|
||||||
|
|
||||||
// Not exported because they're just used for tests.
|
// Not exported because they're just used for tests.
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
_ = ansi;
|
||||||
_ = csi;
|
_ = csi;
|
||||||
_ = stream;
|
_ = stream;
|
||||||
_ = Parser;
|
_ = Parser;
|
||||||
|
Reference in New Issue
Block a user