Terminal
Animated terminal commands and output with shell highlighting and one-click copying.
Usage#
Wrap TerminalStep components in Terminal. Give each step a command and write its output in a terminal fence. Omit the fence for commands without output.
Header#
Set title to choose the header text.
Shell#
Set shell to bash for Bash or ps for PowerShell. It controls the prompt prefix and command highlighting. The default is bash.
Working Directory#
Set cwd to show a directory in the prompt. Override it on a step after a directory change.
cwd is display metadata. It does not execute a command or update automatically after cd. It also doesn't affect the copy output.
Height#
Set height=max to reserve space for every response screen. This is the default. Set a pixel height for a fixed, vertically scrollable terminal.
Inline output and imported cast files are compiled into recordings and included in the page response. Playback uses that data directly, without fetching a recording file. Dimensions are checked during compilation, so height=max reserves the output's space before playback starts.
Each recording must fit within the 2 MB limit, including recordings generated from inline output. Cast files are read during the build; changing a file updates the embedded recording when the page is rebuilt.
Long commands and output scroll horizontally together without wrapping.
Compact#
Set compact=true to align the terminal's borders with the text column without changing its inner padding. This only affects desktop layout; mobile terminals remain edge-to-edge.
Custom Input#
Use a terminal fence inside a step for line-by-line output. This format supports plain text, wait directives, and ANSI colors without a separate recording file.
Timing#
Lines in a terminal fence print instantly. Put \-300ms on its own line to wait 300 milliseconds before printing more output.
Empty lines are preserved. Wait directives do not add a line. Use \\-300ms to print a literal \-300ms line. A wait at the end delays the next step.
Colors#
Use ANSI color and style sequences in the output. Write the escape character as \x1b, and use \x1b[0m to reset the style.
Asciinema Recordings#
Use an asciicast .cast file for interactive prompts, per-character output, or progress lines that update in place. Versions 2 and 3 are supported.
Step 1: Prepare the recording#
Record each command separately so each file contains one step's response.Step 2: Add the file#
Place the recording in the application's public folder, such aspublic/recordings/brief-init.cast.Step 3: Reference the recording#
Set
srcon aTerminalStepto the file's site-root URL. Paths relative to the Markdown file are not supported.A step can have a recording or an inline fence, but not both.
Terminal Reference#
syncValueDefaultundefinedstringSelection value when this surface is a direct child of synchronized CodeTabs.
titleDefaultundefinedstringHeader title. Defaults to the shell name when omitted.
shellDefaultundefined"bash" | "ps"Default shell for the group. Defaults to bash.
cwdDefaultundefinedstringDirectory displayed before the command. This does not execute a directory change.
compactDefaultfalsebooleanAlign borders with the content column on desktop without changing inner padding. Mobile terminals remain edge-to-edge.
heightDefaultundefined"max" | numberViewport height in pixels, or max to reserve all response screens. Defaults to max.
TerminalStep Reference#
commandRequiredstringOne command line, without the shell prefix. Copying uses this exact text.
shellDefaultundefined"bash" | "ps"Shell for this command. Defaults to the parent Terminal shell.
cwdDefaultundefinedstringDirectory displayed before the command. This does not execute a directory change.
srcDefaultundefinedstringSite-root URL of a public .cast recording. Use instead of an inline terminal fence.