1
1
mirror of https://github.com/wez/wezterm.git synced 2025-01-08 23:17:36 +03:00

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 2023-03-23 11:54:23 -07:00
parent 16f5d116e7
commit f2a2d099bb
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

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());