quarto-term
Persistent interactive terminal sessions for Quarto
quarto-term is a Quarto extension that runs commands in a real, persistent shell session. State carries across cells, colors render faithfully, and you can drive fullscreen TUI apps, all from your .qmd file.
quarto-term is great for:
- Documentation and tutorials: CLI tools, shell concepts, installation guides, git workflows, and API exploration with real output and persistent state
- Technical books and courses: faithful terminal rendering for any “type this, see that” sequence, including TUI walkthroughs, database demos, and data pipeline chains
- DevOps and security: runbooks, CTF writeups, and environment setup guides where colored tool output and multi-step sessions matter
date
Sat Aug 15 12:52:41 PM UTC 2026
EXTENSION_NAME="quarto-term"
cowsay "Hello, I'm rendered using $EXTENSION_NAME"
_______________________________________
< Hello, I'm rendered using quarto-term >
---------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
htop
0[ 0.0%] Tasks: 42, 111 thr, 107 kthr; 1 runnin
1[ 0.0%] Load average: 0.35 0.52 0.27
2[ 0.0%] Uptime: 00:05:34
3[ 0.0%]
Mem[||||||||||||||||| 1012M/15.6G]
Swp[ 0K/3.00G]
[Main] [I/O]
PID USER PRI NI VIRT RES SHR S CPU%▽MEM% TIME+ Command
5243 runner 20 0 8352 4948 3968 R 9.8 0.0 0:00.11 htop
1 root 20 0 22876 14340 9880 S 0.0 0.1 0:02.18 /sbin/init
155 root 19 -1 91464 16456 15172 S 0.0 0.1 0:00.18 /usr/lib/syst
221 root RT 0 298M 43676 8760 S 0.0 0.3 0:00.01 /sbin/multipa
226 root 20 0 25956 8032 5220 S 0.0 0.0 0:00.11 /usr/lib/syst
228 root 20 0 298M 43676 8760 S 0.0 0.3 0:00.00 /sbin/multipa
229 root RT 0 298M 43676 8760 S 0.0 0.3 0:00.00 /sbin/multipa
230 root RT 0 298M 43676 8760 S 0.0 0.3 0:00.00 /sbin/multipa
231 root RT 0 298M 43676 8760 S 0.0 0.3 0:00.00 /sbin/multipa
232 root RT 0 298M 43676 8760 S 0.0 0.3 0:00.00 /sbin/multipa
233 root RT 0 298M 43676 8760 S 0.0 0.3 0:00.00 /sbin/multipa
309 root 20 0 3848 2972 2052 S 0.0 0.0 0:00.05 /usr/lib/linu
411 systemd-re 20 0 21476 13380 11164 S 0.0 0.1 0:00.10 /usr/lib/syst
F1Help F2Setup F3SearchF4FilterF5Tree F6SortByF7Nice -F8Nice +F9Kill F10Quit
All of the above was produced from a single .qmd file using quarto-term.
Why quarto-term?
Quarto’s built-in bash engine executes each code cell in an isolated subshell. That means:
- Variables,
cd, and other state don’t persist between cells. - You can’t show interactive TUI applications (htop, vim, nyancat).
- Output is plain text with no ANSI color support.
- There’s no way to send special keys (Ctrl-C, arrow keys).
- You can’t produce terminal recordings alongside your document.
quarto-term solves all of these by running a single persistent shell session that all cells share. It captures output using a real terminal emulator (including colors, cursor movement, and fullscreen apps), and can optionally produce asciicast or termshow recordings for playback.
Features
- Persistent sessions. State carries across cells (variables, working directory, shell history).
- ANSI color rendering. Faithfully renders colored output as HTML/LaTeX.
- Fullscreen capture. Capture TUI apps like htop, vim, or nyancat.
- Special keys. Send Ctrl-C, arrow keys, Enter, Escape, and more.
- Human typing simulation. Configurable speed and error rate for realistic recordings.
- Terminal recordings. Produce
.cast(asciicast v2) or.termshowfiles alongside your document. - Line options. Control timing, key behavior, and prompt expectations per line.
- Multi-line commands. Automatic PS2 continuation prompt detection.
- Styling. Built-in colorschemes with light/dark mode support, fonts, and sizing.
- Multiple output formats. HTML, LaTeX/PDF, and Markdown.
Quick install
quarto add jeroenjanssens/quarto-termOn first render, the correct binary for your platform is automatically downloaded from GitHub Releases and cached locally. Supported platforms: macOS (ARM and Intel), Linux (x86_64 and ARM), and Windows.
See Get Started for a complete walkthrough.