Skip to content

feat: Options.Prompt, a prompt that follows the shell - #6

Merged
tannevaled merged 1 commit into
mainfrom
feat/prompt
Nov 9, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/prompt

Conversation

@tannevaled

@tannevaled tannevaled commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Adds Options.Prompt func() string, so a host can show state the shell changes (a working directory, the last status). wasmdesk/wasmbox's terminal needs it: it showed the working directory in its prompt before the move to shellterm.

Refs wasmdesk/wasmbox#173

  • Asked at Attach / SetShell and after each command, on the session goroutine with the session locked, once Run has returned.
  • Control characters are dropped from the result (the width is counted as one line of text); an empty result keeps the previous prompt.
  • The default stays $ : dashboard v0.9.0 and any caller that does not set it are unchanged.
  • Additive, below v1: tag v0.1.1 (below v1 only a breaking change moves MINOR).
  • 100 % coverage kept (TestSessionPromptHook), -race clean; README updated.

🤖 Generated with Claude Code

Options.Prompt (optional) returns the prompt; the session asks for it at
Attach/SetShell and after each command, once Run has returned, so a host can
show a working directory or the last status. Control characters are dropped,
an empty answer keeps the previous prompt, and the default stays "$ ", so
existing users (go-wasmcontainers/dashboard v0.9.0) are unchanged.

Additive: v0.1.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit f4b72dd into main Nov 9, 2026
12 checks passed
@tannevaled
tannevaled deleted the feat/prompt branch November 9, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant