mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
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:
@ -77,8 +77,10 @@ pub fn run(alloc: Allocator) !u8 {
|
|||||||
|
|
||||||
fn prettyPrint(alloc: Allocator, keybinds: Config.Keybinds) !u8 {
|
fn prettyPrint(alloc: Allocator, keybinds: Config.Keybinds) !u8 {
|
||||||
// Set up vaxis
|
// Set up vaxis
|
||||||
var vx = try vaxis.init(alloc, .{});
|
|
||||||
var tty = try vaxis.Tty.init();
|
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();
|
var buf_writer = tty.bufferedWriter();
|
||||||
const writer = buf_writer.writer().any();
|
const writer = buf_writer.writer().any();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user