Summary
Allow a saved snippet to be used as a host Pre-command (and Post-command), in addition to the current inline command string. The docs already describe this as if it exists, but the implementation only supports a literal inline command — so this is both a feature request and a docs/product mismatch to close.
Current behavior
The host Pre/Post command fields are plain single-line text inputs whose raw string is written verbatim to the shell. There is no snippet integration anywhere in the path:
- UI —
ConnectionForm.tsx:567-583: plain <input> fields (placeholders "Pre Command" / "Post Command"). No snippet picker / reference.
- Passthrough —
connection.pre_command → sessionStore.ts:131 → ssh.ts:52, untouched.
- Backend — typed straight into the shell:
client.rs:892 — writer.write_all(format!("{}\n", cmd)) on connect
session.rs:242/256 — same for post_command on disconnect
No snippet_id resolution, no steps expansion, no snippet lookup. Multi-step snippets — snippet-call and transfer steps (SnippetStep, types/index.ts:234) — cannot run here at all. A one-line snippet only "works" if you manually paste its command text (i.e. it's inline, not a snippet).
Docs mismatch
https://docs.voltius.app/terminal/snippets currently claims:
"Set a snippet as the Pre-command on a host (connection form → Advanced) to run it every time you connect."
That capability does not exist today. Either the docs should be corrected or the feature built — this issue proposes building it.
Proposed behavior
- Let the Pre-command and Post-command fields accept either an inline command string (current behavior — must keep working) or a reference to a saved snippet.
- Add a snippet picker affordance next to each field (e.g. a small "insert snippet" button) that stores a snippet reference.
- On connect (pre) / disconnect (post), resolve the snippet and run its full step sequence — including multi-step, snippet-call, and transfer steps — reusing the existing snippet-run engine rather than just writing a raw line.
- Post-command clarification: it currently runs on disconnect, not connect; the docs only mention pre-command. Decide whether snippet-as-post-command is in scope and document accordingly.
Requirements / constraints
- Inline commands must remain fully supported. The field is a superset, not a replacement.
- Reuse the existing snippet execution path so behavior matches running the snippet manually.
- Storage: a connection needs to persist whether pre/post is an inline string or a snippet reference (
pre_command is currently Option<String>).
Acceptance
Summary
Allow a saved snippet to be used as a host Pre-command (and Post-command), in addition to the current inline command string. The docs already describe this as if it exists, but the implementation only supports a literal inline command — so this is both a feature request and a docs/product mismatch to close.
Current behavior
The host Pre/Post command fields are plain single-line text inputs whose raw string is written verbatim to the shell. There is no snippet integration anywhere in the path:
ConnectionForm.tsx:567-583: plain<input>fields (placeholders "Pre Command" / "Post Command"). No snippet picker / reference.connection.pre_command→sessionStore.ts:131→ssh.ts:52, untouched.client.rs:892—writer.write_all(format!("{}\n", cmd))on connectsession.rs:242/256— same forpost_commandon disconnectNo
snippet_idresolution, nostepsexpansion, no snippet lookup. Multi-step snippets — snippet-call and transfer steps (SnippetStep,types/index.ts:234) — cannot run here at all. A one-line snippet only "works" if you manually paste its command text (i.e. it's inline, not a snippet).Docs mismatch
https://docs.voltius.app/terminal/snippets currently claims:
That capability does not exist today. Either the docs should be corrected or the feature built — this issue proposes building it.
Proposed behavior
Requirements / constraints
pre_commandis currentlyOption<String>).Acceptance