troupe --prompt TEXT opens the TUI with TEXT on its command line and the cursor after it, nothing sent until Enter; only the TUI mode reads it¶
TUI decision 150 · accepted · 2026-10-07 · issue #378
Issue #378, root Decision 808. The VS Code extension's "Ask Troupe About This File" puts the file's path in the TUI's prompt, and Decision 765 found no way into the prompt from outside.
- A flag, not the protocol. The text is the person's own, typed nowhere yet, so it
never needs to reach the daemon:
troupe --prompt TEXThands it to the window this VM opens, and the session is created as for a baretroupe. The command line, the input whose line goes to the session's agent, opens holding TEXT exactly as given (a newline included: the box holds multi-line text), the cursor after its last grapheme, the focus on it. Enter sends it as it sends anything typed there; Esc empties it. - The TUI mode only.
--promptis parsed for every mode, as every switch is, and onlytroupeitself (with--workspaceor not) reads it:runhas its task, and a report has no input. With--remote, HQ is in front and the text waits on the command line behind it. Runner.window_opts/1. What the runner hands the window (HQ's page, the prompt, the mouse) is one public function, so the suite opens a TUI with what the runner would.- A crash's restart mounts the window again with the same options, so it opens with the text again; nothing is sent either way.
- Proof:
cli_test.exs:--promptwith--workspaceopens a TUI on the session with the text (a quoted path with a space) on its command line and the cursor after it, what is typed next goes after it, and the session has no input. On the chunk's tip it failed withunknown option: --prompt.cli_reference_test.exsholds the new row to the parser and the help. The installedtroupe.exeopened by the extension with--promptshowed the path in its input.
Governs: clients/tui/lib/troupe/cli.ex, clients/tui/lib/troupe/cli/runner.ex, clients/tui/lib/troupe/ui/tui/server.ex