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

Function exec_or_wait

crates/openshell-cli/src/ssh.rs:227–251  ·  view source on GitHub ↗
(mut command: Command, replace_process: bool)

Source from the content-addressed store, hash-verified

225}
226
227fn exec_or_wait(mut command: Command, replace_process: bool) -> Result<()> {
228 if replace_process && std::io::stdin().is_terminal() {
229 #[cfg(unix)]
230 {
231 let err = command.exec();
232 return Err(miette::miette!("failed to exec ssh: {err}"));
233 }
234 }
235
236 #[cfg(unix)]
237 let _signal_guard = if !replace_process && std::io::stdin().is_terminal() {
238 reset_transient_tty_signals(&mut command);
239 Some(ParentSignalGuard::ignore_transient_tty_signals()?)
240 } else {
241 None
242 };
243
244 let status = command.status().into_diagnostic()?;
245
246 if !status.success() {
247 return Err(miette::miette!("ssh exited with status {status}"));
248 }
249
250 Ok(())
251}
252
253async fn sandbox_connect_with_mode(
254 server: &str,

Callers 2

sandbox_exec_with_modeFunction · 0.85

Calls 3

execMethod · 0.45
successMethod · 0.45

Tested by

no test coverage detected