Repository navigation
bug: TUI create command loses quoted argument grouping #4113
Description
User Story
I use OpenShell's TUI to create sandboxes and run an initial command after creation. I directly encountered the Command field failing to preserve quoted argument grouping, which prevents commands with script bodies or arguments containing spaces from running as entered.
Problem Statement
The Create Sandbox modal does not preserve quoting used to group command arguments. The sandbox reaches Ready, but the post-create command returns without producing its expected output.
This occurs with a command that uses only /bin/sh built-ins, so it does not depend on an additional package in the sandbox.
Impact / Why This Matters
Post-create commands that require arguments containing whitespace, empty arguments, or a quoted sh -c script cannot be expressed reliably through the TUI. The current workaround is to leave Command empty, wait for creation, connect to the sandbox, and run the command manually. That breaks the intended one-step create-and-run workflow.
Acceptance Criteria
- Quoted text in the TUI Command field remains one command argument, including embedded whitespace.
- The reproduction command prints
GOODand waits for Enter before returning to the TUI. - Malformed quoting is reported clearly before sandbox creation starts.
- Shell operators are not implicitly evaluated unless the user explicitly invokes a shell such as
sh -c.
Reproduction Steps
-
Start OpenShell with a healthy local gateway.
-
Run
openshell term. -
Focus the Sandboxes panel and press
cto open Create Sandbox. -
Enter a unique sandbox name and leave Image, Providers, and Ports empty.
-
Enter this Command:
/bin/sh -c "echo GOOD; read x" -
Submit the form and wait for the sandbox to become Ready.
Expected
The TUI temporarily yields to the command, prints:
GOOD
The read built-in waits for Enter before the TUI resumes.
Actual
The sandbox becomes Ready, but the command prints nothing and the TUI resumes without waiting for Enter. After quitting the TUI, the restored terminal buffer shows an unterminated-quote error.
Environment
- OpenShell: v0.1.2
- Host OS: macOS 27.0.1 (arm64)
- Gateway: local
openshellgateway, user registration, healthy - Workspace:
default - Sandbox image:
nvcr.io/nvidia/base/ubuntu:24.04 - Providers: none
- Forwarded ports: none
Suggested UX
Treat quoting and escaping in the Command field as argument-grouping syntax. Preserve the resulting structured arguments when invoking the remote command. Shell syntax should remain literal unless the user explicitly requests shell evaluation, for example:
/bin/sh -c "echo GOOD; read x"Additional Context
PR #81 introduced the TUI post-create command workflow. Its discussion and tests do not cover quoted argument grouping. I found no existing issue or active pull request for this symptom, and the same command path remains present on current main at 8719fc9f.
Logs
GOOD;: 1: Syntax error: Unterminated quoted string
Activity
abnormal749 commentedon Oct 2, 2026
I reported this issue and would also like to contribute the fix. I noticed #4135 addresses the same problem. Could a maintainer advise whether I should proceed with my own implementation or coordinate with that contributor? I’d like to avoid duplicate effort.