feat(cli): detach sandbox sessions with Ctrl-D (#3744)

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
This commit is contained in:
Drew Newberry
2026-09-28 09:36:14 -07:00
committed by GitHub
parent 45e3308d39
commit 36b0386c92
6 changed files with 86 additions and 26 deletions
+10 -9
View File
@@ -252,11 +252,11 @@ Attach to the canonical main process in a running sandbox:
openshell sandbox connect my-sandbox
```
Press `Ctrl-P`, then `Ctrl-Q` in sequence to disconnect. The main process keeps
running and its stdin stays open. A later `connect` attaches to the same process
instance and replays up to 1 MiB of recent output. One attachment owns stdin
at a time. Use `sandbox exec --tty -- /bin/bash -l` when you want a new
independent shell instead.
Press `Ctrl-D` or `Ctrl-P`, then `Ctrl-Q` in sequence to disconnect. The main
process keeps running and its stdin stays open. A later `connect` attaches to
the same process instance and replays up to 1 MiB of recent output. One
attachment owns stdin at a time. Use `sandbox exec --tty -- /bin/bash -l` when
you want a new independent shell instead.
If an established connection is interrupted, for example when a laptop sleeps
and wakes, the CLI obtains a new SSH session and reattaches to the same main
@@ -265,11 +265,12 @@ authentication failures, sandbox lifecycle changes, and clean SSH exits are
not retried.
`Ctrl-C` retains its normal terminal behavior and interrupts the foreground
process. For read-only attachments, `Ctrl-C` only exits the current viewer.
process. For read-only attachments, `Ctrl-C` or `Ctrl-D` exits only the current
viewer.
OpenSSH's `~.` escape reports the same status as a broken transport, so it
starts automatic recovery instead of exiting. After `~.`, use `Ctrl-P`, then
`Ctrl-Q` once OpenShell reattaches, or press `Ctrl-C` while the CLI is between
retry attempts to cancel recovery.
starts automatic recovery instead of exiting. After `~.`, use `Ctrl-D` or
`Ctrl-P`, then `Ctrl-Q` once OpenShell reattaches, or press `Ctrl-C` while the CLI
is between retry attempts to cancel recovery.
Launch VS Code or Cursor directly into the sandbox workspace: