Only register signal handlers after the first successful write to the screen
This commit is contained in:
parent
ba051a041d
commit
149e09f119
10
src/pane.zig
10
src/pane.zig
@ -41,6 +41,11 @@ pub fn set_layout(layout: *Pane, initial_focus: *Pane) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(term_io: *TermIO) !void {
|
pub fn init(term_io: *TermIO) !void {
|
||||||
|
term_io.enterRawMode();
|
||||||
|
term_io.saveScreen();
|
||||||
|
term_io.hideCursor();
|
||||||
|
term_io.flush();
|
||||||
|
|
||||||
var resize_handler = std.posix.Sigaction{
|
var resize_handler = std.posix.Sigaction{
|
||||||
.handler = .{ .handler = resize_signal },
|
.handler = .{ .handler = resize_signal },
|
||||||
.mask = std.posix.empty_sigset,
|
.mask = std.posix.empty_sigset,
|
||||||
@ -62,11 +67,6 @@ pub fn init(term_io: *TermIO) !void {
|
|||||||
};
|
};
|
||||||
try std.posix.sigaction(std.posix.SIG.SEGV, &panic_handler, null);
|
try std.posix.sigaction(std.posix.SIG.SEGV, &panic_handler, null);
|
||||||
|
|
||||||
term_io.enterRawMode();
|
|
||||||
term_io.saveScreen();
|
|
||||||
term_io.hideCursor();
|
|
||||||
term_io.flush();
|
|
||||||
|
|
||||||
window.resize(term_io);
|
window.resize(term_io);
|
||||||
try window.draw(term_io);
|
try window.draw(term_io);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user