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

Function sandbox_connect_with_mode

crates/openshell-cli/src/ssh.rs:253–278  ·  view source on GitHub ↗
(
    server: &str,
    name: &str,
    tls: &TlsOptions,
    replace_process: bool,
)

Source from the content-addressed store, hash-verified

251}
252
253async fn sandbox_connect_with_mode(
254 server: &str,
255 name: &str,
256 tls: &TlsOptions,
257 replace_process: bool,
258) -> Result<()> {
259 let session = ssh_session_config(server, name, tls).await?;
260
261 let mut command = ssh_base_command(&session.proxy_command);
262 command
263 .arg("-tt")
264 .arg("-o")
265 .arg("RequestTTY=force")
266 .arg("-o")
267 .arg("SetEnv=TERM=xterm-256color")
268 .arg("sandbox")
269 .stdin(Stdio::inherit())
270 .stdout(Stdio::inherit())
271 .stderr(Stdio::inherit());
272
273 tokio::task::spawn_blocking(move || exec_or_wait(command, replace_process))
274 .await
275 .into_diagnostic()??;
276
277 Ok(())
278}
279
280/// Connect to a sandbox via SSH.
281pub async fn sandbox_connect(server: &str, name: &str, tls: &TlsOptions) -> Result<()> {

Callers 2

sandbox_connectFunction · 0.85

Calls 3

ssh_session_configFunction · 0.85
ssh_base_commandFunction · 0.85
exec_or_waitFunction · 0.85

Tested by

no test coverage detected