Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Fix demo command tracking and simplify Try it copy (#4546)

Maximilian Roosab9cecb171de
diff --git a/docs/demos/demoshell/README.md b/docs/demos/demoshell/README.md
index 80c84e239..50d0955b7 100644
--- a/docs/demos/demoshell/README.md
+++ b/docs/demos/demoshell/README.md
@@ -14,6 +14,8 @@ The VM's definition is kept here and entered into the Demoshell studio, where th
Set **When a visitor opens the VM → Start an app** to `bash --rcfile /root/after-load.sh`. Demoshell's shell-prompt mode runs ash even if the recipe changes root's login shell. Starting bash explicitly loads Worktrunk's shell integration so switching and merging move the visitor's shell.
+`after-load.sh` supplies the prompt prefix Demoshell uses to identify commands and an OSC 133 exit-status marker so the guide can verify whether they succeeded.
+
To check the full recipe before a Studio build, run this from the repository root with Docker:
```bash
diff --git a/docs/demos/demoshell/after-load.sh b/docs/demos/demoshell/after-load.sh
index 100a494cd..2fbcd5b8e 100644
--- a/docs/demos/demoshell/after-load.sh
+++ b/docs/demos/demoshell/after-load.sh
@@ -1,5 +1,15 @@
# Bash rcfile for Demoshell's "Start an app" command; see README.md.
. "$HOME/.bashrc"
+# Demoshell strips this prefix from typed commands and reads OSC 133 exit
+# markers to verify command success. Bash needs its own marker after each command.
+PS1='arm64js:\[\e[32m\]\W\[\e[0m\] $ '
+# The first prompt has no completed command. Install reporting there so Studio
+# does not mistake an initial exit marker for the start app exiting.
+_demoshell_first_prompt() {
+ PROMPT_COMMAND='printf "\033]133;D;%s\007" "$?"'
+ unset -f _demoshell_first_prompt
+}
+PROMPT_COMMAND=_demoshell_first_prompt
cd "$HOME/acme"
clear
echo "A git repository with two worktrees in flight. Follow the guide to the right."
diff --git a/docs/demos/demoshell/guide.json b/docs/demos/demoshell/guide.json
index 3a4efcce2..d801805da 100644
--- a/docs/demos/demoshell/guide.json
+++ b/docs/demos/demoshell/guide.json
@@ -59,7 +59,7 @@
"body": "Run wt switch to open a picker: type to filter, move with the arrow keys, Enter to switch, Esc to leave. Mark this step done when you've tried it.",
"kind": "manual",
"match_mode": "exact",
- "pattern": null,
+ "pattern": "",
"output_contains": null,
"require_success": false,
"optional": true
diff --git a/docs/demos/demoshell/recipe.sh b/docs/demos/demoshell/recipe.sh
index 2c25fc79e..4a3770e72 100644
--- a/docs/demos/demoshell/recipe.sh
+++ b/docs/demos/demoshell/recipe.sh
@@ -13,8 +13,6 @@ rm -rf /tmp/worktrunk-aarch64-unknown-linux-musl
# Studio launches bash explicitly with after-load.sh as its rcfile; changing
# root's login shell would not change Demoshell's running ash session.
-# Demoshell's command tracker requires the arm64js: prompt prefix.
-echo 'PS1='"'"'arm64js:\[\e[32m\]\W\[\e[0m\] $ '"'" > "$HOME/.bashrc"
wt config shell install bash --yes
git config --global user.name "Demo User"
diff --git a/docs/src/pages/try-it.astro b/docs/src/pages/try-it.astro
index a2b8ed6d5..4b02e982d 100644
--- a/docs/src/pages/try-it.astro
+++ b/docs/src/pages/try-it.astro
@@ -12,7 +12,7 @@ const launchUrl = `${server}/launch?snapshot=${encodeURIComponent(snapshot)}`;
<StarlightPage
frontmatter={{
title: 'Try it',
- description: 'Run Worktrunk in your browser: a Linux VM with wt installed and a guided walk through creating, merging, and removing a worktree.',
+ description: 'Try Worktrunk in your browser.',
editUrl: false,
tableOfContents: false,
pagefind: false,
@@ -20,15 +20,11 @@ const launchUrl = `${server}/launch?snapshot=${encodeURIComponent(snapshot)}`;
}}
>
<p>
- Run Worktrunk in a Linux VM inside this browser tab — no install, and nothing
- you type leaves your machine. The guide beside the terminal walks through a
- worktree's whole life: create one, change a file, and merge it back to
- <code>main</code>.
+ Run Worktrunk in your browser. No installation needed.
</p>
<p>
- Nothing downloads until you press run. Chrome and Edge run the VM in the
- page. <a href={launchUrl}>Open the full-page demo</a> if your browser cannot
- run it here.
+ Nothing downloads until you press Run.{' '}
+ <a href={launchUrl}>Open the full-page demo</a> if your browser cannot run it here.
</p>
<div class="wt-try-it" data-server={server} data-snapshot={snapshot}>
@@ -41,9 +37,7 @@ const launchUrl = `${server}/launch?snapshot=${encodeURIComponent(snapshot)}`;
</p>
<p>
- Ready for the real thing? <a href="/#install">Install Worktrunk</a>, then run
- <code>wt config shell install</code> so <code>wt switch</code> can change
- directory.
+ <a href="/#install">Install Worktrunk</a>
</p>
</StarlightPage>