Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/zek.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,12 @@ pub const UserInterface = struct {
}
};

fn reset_term() void {
if (builtin.os.tag != .windows) {
std.io.getStdOut().writer().print("\x1b[0m", .{}) catch {};
}
}

pub fn main() !void {
if (builtin.os.tag != .windows) {
var tty: std.fs.File = try std.fs.cwd().openFile("/dev/tty", .{ // .mode = std.fs.File.OpenMode.read_write
Expand All @@ -1748,6 +1754,7 @@ pub fn main() !void {
}
try std.io.getStdOut().writer().print("\x1b[37;1m", .{});
}
defer reset_term();

var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer {
Expand All @@ -1771,7 +1778,4 @@ pub fn main() !void {
var userInterface = try UserInterface.init(gpa.allocator());
defer userInterface.deinit();
try userInterface.eventLoop(false);
if (builtin.os.tag != .windows) {
try std.io.getStdOut().writer().print("\x1b[0m", .{});
}
}