cli/list-keybinds: restore terminal after exit

Deinit the tty and vaxis to restore the terminal upon exiting the
command
This commit is contained in:
Tim Culverhouse
2024-08-06 13:28:25 -05:00
parent 1e91efbbe5
commit b0ac75d5bc

View File

@ -77,8 +77,10 @@ pub fn run(alloc: Allocator) !u8 {
fn prettyPrint(alloc: Allocator, keybinds: Config.Keybinds) !u8 {
// Set up vaxis
var vx = try vaxis.init(alloc, .{});
var tty = try vaxis.Tty.init();
defer tty.deinit();
var vx = try vaxis.init(alloc, .{});
defer vx.deinit(alloc, tty.anyWriter());
var buf_writer = tty.bufferedWriter();
const writer = buf_writer.writer().any();