Opal Terminal

opal's own terminal app. It reads the same config.toml as the prompt, takes its colors from the same theme, and uses the marks the prompt sends around each command, so the terminal and your shells work as one tool. On Windows it comes with its own bash, Opal Bash.

Opal Terminal is developed and used on Windows. The macOS and Linux builds pass their tests in CI on every change, but haven't been used on a real Mac or Linux desktop yet. Reports are welcome.

opal doesn't need it: the prompt and everything else on this site work in any terminal. It also runs any shell or program, not only ones set up with opal; the features that follow commands need a prompt that sends OSC 133 marks, as opal's does.

Installing and opening it

The install scripts install Opal Terminal along with opal:

SystemWhere it goesHow to open it
Windows%LOCALAPPDATA%\opal\terminal, with Opal Bash in its shell folderOpal Terminal in the Start menu
macOS~/Applications/Opal Terminal.appLaunchpad or Spotlight
Linux~/.local/bin/opal-terminal, with a menu entryYour desktop's app menu

From any shell, opal terminal opens it in the current folder. Its options come after that: -profile NAME picks the shell, -dir PATH another folder, and a command after them runs instead of a shell.

opal terminal
opal terminal -profile "Windows PowerShell"
opal terminal htop

A few things about the install:

opal update updates the opal program only. To update Opal Terminal, run the install script again. On Windows, close Opal Terminal first: the script won't replace files that are in use.

Opal Bash

On Windows, Opal Terminal comes with its own bash. It's MSYS2's bash with the Unix tools you'd expect: coreutils (ls, cp, mv, cat, sort, wc and the rest), grep, sed, awk, find and xargs, diff, less, tar, gzip and which. New tabs open it unless shell in the [terminal] settings names another shell.

It's kept apart from the rest of the machine:

Aliases and functions for every shell belong in config.toml. For things only bash understands, create ~/.config/opal/bashrc; Opal Bash reads it after loading opal:

# ~/.config/opal/bashrc
shopt -s globstar
export LESS=-R

The tools are MSYS2 packages, pinned by version and checksum in the repository's packages.lock. MSYS2 builds them for x64 only, so the ARM64 download has the x64 build, which Windows 11 on ARM runs under emulation; that hasn't been tried yet. Most of them are under the GPL: shell/PACKAGES.txt lists each package's license, and each release has their source as opal-terminal_shell-sources.tar.

Shells and profiles

The command palette has a "New tab" entry for each shell Opal Terminal finds. On Windows that's Opal Bash, PowerShell 7, Windows PowerShell, Command Prompt and each WSL distribution, plus other shells it recognizes. On macOS and Linux it's your login shell and the ones in /etc/shells. opal-terminal -list-profiles prints the list.

shell picks the one new tabs open, by name or as a command line. Your own profiles can run any command, with arguments, a starting folder and environment variables:

[terminal]
shell = "PowerShell"

[[terminal.profiles]]
name = "work box"
command = "ssh"
args = ["me@work"]

What it does

Tabs and panes

Following your commands

With opal's prompt, the terminal knows where each command starts and ends:

Opal Terminal bundles the Nerd Font symbols, so opal's prompt uses Nerd Font icons inside it without installing a font.

Command palette, history and folders

Ctrl+Shift+P lists every action with its key, fuzzy-matched as you type. After the actions come the aliases and functions opal defines in the pane's shell, from the enabled plugins and from your config: Enter types one at the prompt, Shift+Enter runs it. An alias is typed as the command it stands for. Start the query with $ to list only those.

Start the query with ! to search opal's shared history from every shell instead: Enter types the command at the prompt, Shift+Enter runs it. Start it with @ to list the folders j knows, most used first; Enter opens a new tab there. Ctrl+Shift+H and Ctrl+Shift+J open those two lists directly.

Quick select

Ctrl+Shift+Space puts a one- or two-letter label on every URL, path, git hash, IP address, email address and UUID on screen. Typing a label copies that match; typing it in uppercase also pastes it at the prompt. The labels start on the home row.

Find, selection and links

Inline images

Sixel, the kitty graphics protocol and iTerm2's image sequence all work, so programs that show pictures in the terminal can use whichever they support. Images belong to the line they start on: they scroll, reflow and leave the scrollback with their text. kitty's Unicode placeholders and animation aren't supported yet.

The ConPTY built into Windows drops the escape sequences images use, so the Windows download includes Microsoft's newer conpty.dll and OpenConsole.exe, and Opal Terminal uses them.

Text and colors

Notifications and the clipboard

Programs can post desktop notifications (OSC 9, 99 and 777). They show as notifications on Windows, in Notification Center on macOS, and through the desktop's notification service on Linux. By default they only appear when the window isn't focused.

Programs may set the clipboard (OSC 52), which is how copying works over ssh. Reading it is off by default, since any program you run, including one on a remote machine, could otherwise read what you last copied.

Session restore

When you close the last window, its tabs, splits, shells, folders and up to 2000 lines of each pane's output are saved, and they come back the next time you open Opal Terminal. Closing the last tab instead starts fresh. restore_session = false turns this off.

Keys

The defaults are below. Ctrl+Comma (Cmd+Comma on macOS) opens the settings page, where you can choose an action and press its new shortcut, or press Delete to remove a binding.

ActionWindows and LinuxmacOS
New tab, new windowCtrl+Shift+T, Ctrl+Shift+NCmd+T, Cmd+N
Close the paneCtrl+Shift+WCmd+W
Next, previous tabCtrl+Tab, Ctrl+Shift+TabCtrl+Tab, Ctrl+Shift+Tab
Tab 1 to 9Ctrl+Alt+1 to 9Cmd+1 to 9
Split right, downAlt+Shift+Plus, Alt+Shift+MinusCmd+D, Cmd+Shift+D
Split along the longer sideAlt+Shift+Dpalette
Move between panesAlt+arrowsCmd+Alt+arrows
Move a dividerAlt+Shift+arrowsCmd+Ctrl+arrows
Zoom the paneCtrl+Shift+ZCmd+Shift+Enter
Copy, pasteCtrl+Shift+C, Ctrl+Shift+V (also Ctrl+V on Windows)Cmd+C, Cmd+V
FindCtrl+Shift+FCmd+F
Command paletteCtrl+Shift+PCmd+Shift+P
Quick selectCtrl+Shift+SpaceCmd+Shift+Space
Search history, recent foldersCtrl+Shift+H, Ctrl+Shift+JCmd+Shift+H, Cmd+Shift+J
Previous, next promptCtrl+Up, Ctrl+DownCmd+Up, Cmd+Down
Select the last command's outputCtrl+Shift+Epalette
Font sizeCtrl+Plus, Ctrl+Minus, Ctrl+0Cmd+Plus, Cmd+Minus, Cmd+0
Clear scrollbackCtrl+Shift+KCmd+K
Full screenF11 (also Alt+Enter on Windows)Cmd+Ctrl+F
Broadcast input, rename the tabCtrl+Shift+I, Ctrl+Shift+RCmd+Shift+I, Cmd+Shift+R
SettingsCtrl+CommaCmd+Comma

Keys can also be set in config.toml, by action name. The configuration reference lists the names.

Settings

The settings page covers fonts, cursor, colors, shell, scrollback, notifications, the clipboard and every key. Changes apply as you make them, and are written into the [terminal] table of config.toml line by line, so your comments and the rest of the file stay as they were. opal-terminal -settings opens it at launch. The configuration reference lists every setting.

Building it yourself

It needs Go 1.26 or newer, and cgo on macOS and Linux. The terminal README has the build commands, how Opal Bash and the Windows ConPTY files are fetched, and how the source is laid out.