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:
{ "terminal": { "shell": { "program": "/bin/zsh" } }}To pass arguments:
{ "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.
{ "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:
{ "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
{ "terminal": { "font_family": "JetBrains Mono", "font_size": 14, "line_height": "standard", "cursor_shape": "block", "blinking": "terminal_controlled", "minimum_contrast": 45 }}- Without
font_familyandfont_size, the terminal matches the editor font. line_heightis"standard"(default),"comfortable"or{ "custom": 1.5 }.cursor_shapeis"block"(default),"bar","underline"or"hollow".blinkingis"off","terminal_controlled"(default) or"on".minimum_contrastnudges colors to stay readable.0turns it off.max_scroll_history_linesdefaults to10000, with a maximum of100000.bellcan play an alert sound on the terminal bell. It is"off"by default.copy_on_selectcopies selected text to the clipboard. It isfalseby default.
Cmd-click a path in the terminal output to open it in the editor. Paths with line and column numbers work.