mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
Fix TTY not being cleared sometimes (closes #696)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -783,6 +783,11 @@ pub fn main() !void {
|
|||||||
try info_line.addMessage(lang.logout, config.bg, config.fg);
|
try info_line.addMessage(lang.logout, config.bg, config.fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear the TTY because termbox2 doesn't properly do it
|
||||||
|
const capability = termbox.global.caps[termbox.TB_CAP_CLEAR_SCREEN];
|
||||||
|
const capability_slice = capability[0..std.mem.len(capability)];
|
||||||
|
_ = try std.posix.write(termbox.global.ttyfd, capability_slice);
|
||||||
|
|
||||||
try std.posix.tcsetattr(std.posix.STDIN_FILENO, .FLUSH, tb_termios);
|
try std.posix.tcsetattr(std.posix.STDIN_FILENO, .FLUSH, tb_termios);
|
||||||
if (auth_fails < config.auth_fails) _ = termbox.tb_clear();
|
if (auth_fails < config.auth_fails) _ = termbox.tb_clear();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user