ghostty/src/renderer/cursor.zig
Mitchell Hashimoto c1b70cb788 metal: devmode
2022-10-31 09:44:37 -07:00

20 lines
593 B
Zig

const terminal = @import("../terminal/main.zig");
/// Available cursor styles for drawing that renderers must support.
pub const CursorStyle = enum {
box,
box_hollow,
bar,
/// Create a cursor style from the terminal style request.
pub fn fromTerminal(style: terminal.CursorStyle) ?CursorStyle {
return switch (style) {
.blinking_block, .steady_block => .box,
.blinking_bar, .steady_bar => .bar,
.blinking_underline, .steady_underline => null, // TODO
.default => .box,
else => null,
};
}
};