pty: unix: empty signal mask in the spawned child

A user reported that ctrl-c and ctrl-\ had no effect
for them in bash when spawned in a particular way
on their system.  It turned out that the spawning
environment had blocked SIGINT, SIGHUP and SIGQUIT
and that was propagated all the way down through
the wezterm process to the spawned shell.

Let's ensure that we clear all blocked signals
prior to launching our child process.
This commit is contained in:
Wez Furlong committed 2023-03-23 11:55:04 -07:00
1 parent 16f5d116e7
commit f2a2d099bb
1 file changed
+3
+3
View File
@@ -216,6 +216,9 @@ impl PtyFd {
libc::signal(*signo, libc::SIG_DFL);
}
let empty_set: libc::sigset_t = std::mem::zeroed();
libc::sigprocmask(libc::SIG_SETMASK, &empty_set, std::ptr::null_mut());
// Establish ourselves as a session leader.
if libc::setsid() == -1 {
return Err(io::Error::last_os_error());