MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / ignore_transient_tty_signals

Method ignore_transient_tty_signals

crates/openshell-cli/src/ssh.rs:182–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180impl ParentSignalGuard {
181 #[allow(unsafe_code)]
182 fn ignore_transient_tty_signals() -> Result<Self> {
183 let mut previous = Vec::with_capacity(TRANSIENT_TTY_SIGNALS.len());
184 for &signal in TRANSIENT_TTY_SIGNALS {
185 let action = SigAction::new(SigHandler::SigIgn, SaFlags::empty(), SigSet::empty());
186 // SAFETY: `sigaction` is the POSIX API for updating process signal
187 // dispositions. We install `SIG_IGN` for a small fixed set of
188 // terminal signals and store the previous handlers for restoration.
189 let old = unsafe { sigaction(signal, &action) }.into_diagnostic()?;
190 previous.push((signal, old));
191 }
192 Ok(Self { previous })
193 }
194}
195
196#[cfg(unix)]

Callers

nothing calls this directly

Calls 2

lenMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected