add more defaults and make it more presentable
This commit is contained in:
parent
9f0c0d4afb
commit
1d59e48a4f
2 changed files with 34 additions and 3 deletions
16
src/main.zig
16
src/main.zig
|
@ -14,16 +14,22 @@ pub fn main() !void {
|
|||
var term = try Terminal.init(allocator);
|
||||
defer term.deinit();
|
||||
|
||||
try term.print("poopoo", .{});
|
||||
try term.clearScreen();
|
||||
try term.print("fooboo", .{});
|
||||
try term.cursorLeft();
|
||||
try term.cursorLeft();
|
||||
try term.print("ee", .{});
|
||||
try term.print("ar", .{});
|
||||
// try term.cursorSet(12, 3);
|
||||
try term.blinkOn();
|
||||
try term.boldOn();
|
||||
try term.underlineOn();
|
||||
try term.print("AAAAAAAAAAAAAAAAAAA", .{});
|
||||
try term.italicsOn();
|
||||
try term.print("ABCDEFGHIJKLMNOPQRSTUVWXYZ", .{});
|
||||
try term.blinkOff();
|
||||
try term.boldOff();
|
||||
try term.underlineOff();
|
||||
try term.italicsOff();
|
||||
try term.print("eeheeveehee\n", .{});
|
||||
}
|
||||
|
||||
pub const Terminal = struct {
|
||||
|
@ -138,6 +144,10 @@ pub const Terminal = struct {
|
|||
try self.info.writeString(.exit_underline_mode, self.tty.writer(), &[_]u32{});
|
||||
}
|
||||
|
||||
pub fn clearScreen(self: *Terminal) !void {
|
||||
try self.info.writeString(.clear_screen, self.tty.writer(), &[_]u32{});
|
||||
}
|
||||
|
||||
pub const Info = @import("terminfo.zig");
|
||||
|
||||
pub const SpecialKey = enum(u16) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue