From 547f5534047b873254bb696450402108b4c2ee0d Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Sat, 18 Oct 2025 23:30:15 +0200 Subject: [PATCH] fix(terminal): restore screen correctly with alt screen --- src/app.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.zig b/src/app.zig index 5a03783..82af83d 100644 --- a/src/app.zig +++ b/src/app.zig @@ -73,8 +73,8 @@ pub fn App(comptime E: type) type { try terminal.enableRawMode(&termios); if (this.termios) |_| {} else this.termios = termios; - try terminal.saveScreen(); try terminal.enterAltScreen(); + try terminal.saveScreen(); try terminal.hideCursor(); try terminal.enableMouseSupport(); } @@ -82,8 +82,8 @@ pub fn App(comptime E: type) type { pub fn interrupt(this: *@This()) !void { this.quit_event.set(); try terminal.disableMouseSupport(); - try terminal.exitAltScreen(); try terminal.restoreScreen(); + try terminal.exitAltScreen(); if (this.thread) |thread| { thread.join(); this.thread = null; @@ -95,9 +95,9 @@ pub fn App(comptime E: type) type { if (this.termios) |*termios| { try terminal.disableMouseSupport(); try terminal.showCursor(); - try terminal.exitAltScreen(); - try terminal.disableRawMode(termios); try terminal.restoreScreen(); + try terminal.disableRawMode(termios); + try terminal.exitAltScreen(); } this.termios = null; }