Skip to main content
A sequence of seven visual effects generated entirely inside a sandbox VM and streamed byte-for-byte through the PTY to your local terminal. The script uses nothing but Python stdlib and raw ANSI escape codes — no curses, no ncurses, no external deps.

Use case

Stress-test the PTY stream with rapid output, truecolor sequences, cursor movement, and full-screen rewrites. If every effect renders cleanly, you can trust the SSE pipe for any TUI workload an agent might produce.

What you’ll learn

  • Uploading a program with sbx.files.write() to avoid stdin echo
  • 256-colour and 24-bit truecolor rendering via ANSI escapes
  • Animated spinner and progress bar with \r line replacement
  • Box-drawing table output
  • Matrix-style rain with cursor-up rewriting (\e[8A)
  • Combining python3 /tmp/show.py && exit in a single PTY send

Prerequisites

Code walkthrough

The driver uploads a show program and runs it through one PTY session:
The SHOW_PROGRAM (embedded in the source file) runs seven acts:

Running it

Run in an xterm-compatible terminal (iTerm2, Alacritty, Kitty, modern Terminal.app, or any tmux pane):
The full show takes about 8 seconds. You will see the banner paint character by character, the gradient fill, the spinner tick through its braille frames, the progress bar crawl to 100%, a stats table render, and finally Matrix-style green rain scroll down for a few seconds. The closing message reads:

Full source

See cookbook/examples/pty-showcase/main.py in the repo.