Skip to content

Terminal

Tyrn has a built-in terminal. It opens in a panel docked at the bottom, or as a tab next to your files. Agent sessions have their own tabs. This page is about the plain terminal. To start an agent, see Start a session.

Open a terminal

Task How
Show or hide the terminal panel ctrl-`
Open a new terminal ctrl-~
New terminal while one is focused cmd-n
Split the terminal cmd-d
Open a terminal as a tab in the editor area Command palette: workspace: new center terminal
Open a plain shell session Command palette: tyrn: open shell terminal

Each terminal is a tab in the panel. Set terminal.dock to "bottom" (default), "left" or "right", and terminal.starts_open to open the panel at launch.

Keybindings

Task Keybinding
Copy, paste cmd-c, cmd-v
Find in the terminal cmd-f
Clear cmd-k
Scroll a page up or down shift-pageup, shift-pagedown (or cmd-up, cmd-down)
Scroll a line shift-up, shift-down
Scroll to top or bottom shift-home, shift-end
Toggle vi mode in the terminal ctrl-shift-space
Delete to the start of the line cmd-backspace
Jump to start or end of the line cmd-left, cmd-right
Move by word alt-left, alt-right

On macOS, set terminal.option_as_meta to true if you want the option key to act as meta, for example for Emacs shortcuts. It is false by default.

Shell

By default Tyrn uses your system shell. To use another:

settings.json
{
"terminal": {
"shell": { "program": "/bin/zsh" }
}
}

To pass arguments:

settings.json
{
"terminal": {
"shell": {
"with_arguments": { "program": "/bin/bash", "args": ["--login"] }
}
}
}

Working directory

terminal.working_directory decides where new terminals start.

Value Starts in
"current_project_directory" (default) The project of the current file, then the first project
"current_file_directory" The current file’s folder, then the project
"first_project_directory" The first project in the window
"always_home" Your home folder
{ "always": { "directory": "~/code" } } A fixed folder

Environment and Python

Add variables to every terminal with terminal.env. Use : to join several values.

settings.json
{
"terminal": {
"env": { "MY_VAR": "value", "PATH": "/custom/bin:$PATH" }
}
}

Tyrn activates a Python virtual environment when it finds one in the working directory. It looks in .env, env, .venv and venv. To change or disable that:

settings.json
{
"terminal": {
"detect_venv": { "on": { "directories": [".venv"], "activate_script": "default" } }
// or: "detect_venv": "off"
}
}

activate_script also accepts "csh", "fish", "nushell" and "power_shell". conda_manager accepts "auto" (default), "conda", "mamba" and "micromamba".

Appearance

settings.json
{
"terminal": {
"font_family": "JetBrains Mono",
"font_size": 14,
"line_height": "standard",
"cursor_shape": "block",
"blinking": "terminal_controlled",
"minimum_contrast": 45
}
}
  • Without font_family and font_size, the terminal matches the editor font.
  • line_height is "standard" (default), "comfortable" or { "custom": 1.5 }.
  • cursor_shape is "block" (default), "bar", "underline" or "hollow".
  • blinking is "off", "terminal_controlled" (default) or "on".
  • minimum_contrast nudges colors to stay readable. 0 turns it off.
  • max_scroll_history_lines defaults to 10000, with a maximum of 100000.
  • bell can play an alert sound on the terminal bell. It is "off" by default.
  • copy_on_select copies selected text to the clipboard. It is false by default.

Cmd-click a path in the terminal output to open it in the editor. Paths with line and column numbers work.