Various bugfixes

This commit is contained in:
2026-01-29 19:47:12 -05:00
parent 9fea0430c8
commit 5ba521e493
7 changed files with 54 additions and 13 deletions

View File

@@ -103,6 +103,11 @@ pub fn sig_setup() {
flags,
SigSet::empty(),
),
SigAction::new(
SigHandler::Handler(handle_sigwinch),
flags,
SigSet::empty(),
),
];
@@ -114,9 +119,19 @@ pub fn sig_setup() {
sigaction(Signal::SIGINT, &actions[4]).unwrap();
sigaction(Signal::SIGTTIN, &actions[5]).unwrap();
sigaction(Signal::SIGTTOU, &actions[6]).unwrap();
sigaction(Signal::SIGWINCH, &actions[7]).unwrap();
}
}
extern "C" fn handle_sigwinch(_: libc::c_int) {
/* do nothing
* this exists for the sole purpose of interrupting readline
* readline will be refreshed after the interruption,
* which will cause window size calculations to be re-run
* and we get window resize handling for free as a result
*/
}
extern "C" fn handle_sighup(_: libc::c_int) {
GOT_SIGHUP.store(true, Ordering::SeqCst);
SHOULD_QUIT.store(true, Ordering::SeqCst);