Shells
quarto-term works with any shell — or any REPL — that provides a detectable prompt. Set shell to any executable on your system and configure prompt or prompt-regex to match what it emits.
Quick Start with Profiles
For common shells, use profile to set shell, prompt, and PS2 in one line:
extensions:
term:
profile: pythonAvailable profiles:
| Profile | Shell | Prompt | PS2 |
|---|---|---|---|
bash |
bash --norc --noprofile |
$ |
> |
duckdb |
duckdb |
D |
> |
fish |
fish --no-config |
> |
(empty) |
node |
node |
> |
... |
nushell |
nu --no-config-file |
> |
::: |
python |
python3 -q |
>>> |
... |
r |
R --no-save --no-restore --quiet |
> |
+ |
ruby |
irb --noecho --nomultiline |
irb> |
irb* |
sh |
sh |
$ |
> |
sqlite |
sqlite3 |
sqlite> |
...> |
zsh |
zsh --no-rcs |
$ |
> |
Profiles set defaults that you can override individually:
extensions:
term:
profile: python
prompt: "In:" # override just the promptSupported Shells
Each shell below is a live demonstration rendered by quarto-term:
| Shell | Config needed |
|---|---|
| Bash | profile: bash |
| DuckDB | profile: duckdb |
| Fish | profile: fish + init for prompt function |
| Node.js | profile: node |
| Nushell | profile: nushell + inline config via -e |
| POSIX sh | profile: sh |
| Python | profile: python |
| R | profile: r |
| Ruby | profile: ruby + prompt-regex |
| SQLite | profile: sqlite |
| Zsh | profile: zsh (default) |
How It Works
The shell option specifies the executable to spawn. quarto-term then:
- Starts the shell with the given
shell-args - Sets
PS1via the environment (for shells that support it) - Waits for the configured
promptpattern to appear in output - Sends commands and captures output between prompts
For shells that don’t use PS1 (like fish or nushell), configure the prompt through the shell’s own mechanism using init or env, and set prompt or prompt-regex to match it.
Configuration Tips
When adding a new shell, you need:
shell— the executable name or pathshell-args— flags to suppress rc files (for reproducibility)prompt— a literal string that appears at the start of each prompt lineprompt-regex— (optional) a regex override if the prompt is more complexinit— (optional) commands to configure the shell’s prompt
For project-wide configuration in _quarto.yml:
extensions:
term:
shell: fish
shell-args: ["--no-config", "-C", "function fish_prompt; echo -n '$ '; end"]
prompt: "$"Syntax Highlighting
quarto-term captures whatever the shell renders, including ANSI colors. Shells that support syntax highlighting will produce colored output automatically.
| Shell | Syntax highlighting |
|---|---|
| Bash | Not available |
| DuckDB | Built-in (colored SQL and tables) |
| Fish | Built-in; configure fish_color_* variables |
| Node.js | Built-in (colored output values) |
| Nushell | Built-in (enabled by default) |
| POSIX sh | Not available |
| Python | Built-in via PyREPL (3.13+); use strip-auto-indent: true |
| R | Not available |
| Ruby | Built-in via reline (Ruby 3.x+); use strip-auto-indent: true |
| SQLite | Not available |
| Zsh | zsh-syntax-highlighting via init |
Zsh
Add zsh-syntax-highlighting to init. quarto-term auto-detects common installation paths:
extensions:
term:
init:
- zsh-syntax-highlightingFish
Set fish_color_* variables in the -C init argument:
extensions:
term:
shell: fish
shell-args:
- "--no-config"
- "-C"
- "`function fish_prompt; ...; set fish_color_command blue; ...`"See the Fish page for the full list of color variables.