Skip to content

test(tutorial-shell): cover OSC 633 shell-integration reporting - #330

Merged
nedtwigg merged 1 commit into
mainfrom
test/tutorial-shell-osc633
Jul 29, 2026
Merged

test(tutorial-shell): cover OSC 633 shell-integration reporting#330
nedtwigg merged 1 commit into
mainfrom
test/tutorial-shell-osc633

Conversation

@dormouse-bot

Copy link
Copy Markdown
Collaborator

Adds regression coverage for the tutorial shell's OSC 633 shell-integration reporting. Test-only — no production change.

Why

62383e4d made the playground's fake shell (website/src/lib/tutorial-shell.ts) emit OSC 633;A/B/E/C/D and added reportRunningCommand(), and docs/specs/tutorial.md makes these reports load-bearing: the alert tutorial's WATCHING and command-exit demos are driven entirely by them. But tutorial-shell.test.ts only asserted dispatch/echo/history — no test touched a single OSC 633 byte or the 127 exit code. A refactor that dropped or malformed the 633;E command-line report or the 633;D finish would silently break every playground alert demo (panes showing "nothing is running") while the suite stayed green.

Coverage added

Six cases in a new OSC 633 shell integration block:

  • prompt emits 633;A / 633;B
  • a successful run emits 633;E;<command line> + 633;C, no 633;D while running, then 633;D;0 on program exit
  • an unknown command emits 633;D;127
  • an unknown runCommand auto-launch emits 633;D;127
  • reportRunningCommand() re-announces 633;E + 633;C for the running command
  • reportRunningCommand() is a no-op at a prompt

Each assertion fails if the corresponding emission is removed. Found during the nightly code-quality sweep.

The playground shell's OSC 633;A/B/E/C/D emission drives the alert tutorial's
WATCHING and command-exit demos (docs/specs/tutorial.md) but had no test.
Cover the prompt markers, command-line/start reports, exit 0 and 127 finishes,
and reportRunningCommand's re-announce and prompt no-op.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 698e52f
Status: ✅  Deploy successful!
Preview URL: https://be875899.mouseterm.pages.dev
Branch Preview URL: https://test-tutorial-shell-osc633.mouseterm.pages.dev

View logs

@nedtwigg
nedtwigg merged commit 70a84e0 into main Jul 29, 2026
4 checks passed
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.

2 participants