(mut command: Command, replace_process: bool)
| 225 | } |
| 226 | |
| 227 | fn 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 | |
| 253 | async fn sandbox_connect_with_mode( |
| 254 | server: &str, |
no test coverage detected