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:
| System | Where it goes | How to open it |
|---|---|---|
| Windows | %LOCALAPPDATA%\opal\terminal, with Opal Bash in its shell folder | Opal Terminal in the Start menu |
| macOS | ~/Applications/Opal Terminal.app | Launchpad or Spotlight |
| Linux | ~/.local/bin/opal-terminal, with a menu entry | Your 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:
- Set
OPAL_NO_TERMINAL=1before running the install script to leave the terminal out (or pass-NoTerminaltoinstall.ps1). On Linux the script also skips it when no graphical session is running, and on WSL and Termux;OPAL_WITH_TERMINAL=1installs it anyway. - The scripts download
opal-terminal_<os>_<arch>from the latest release and check it againstopal-terminal_SHA256SUMS.txt. Releases after 0.1.0 have these archives. From a clone of the repository they build it instead when Go 1.26 is installed. - If installing the terminal fails, opal itself stays installed, and the script says why.
- On Linux it needs the Wayland or X11, xkbcommon and EGL libraries, which desktop systems already have.
- The macOS app has an ad-hoc signature, not a Developer ID one. The install script's copy opens normally; a copy downloaded with a browser needs
xattr -dr com.apple.quarantine "Opal Terminal.app", or Open Anyway in System Settings > Privacy & Security.
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:
- It reads its own startup file,
shell/etc/opal/bashrcin Opal Terminal's folder, instead of~/.bash_profileand~/.bashrc. That file loads opal, so the prompt, aliases, completion and Ctrl+R history are there withoutopal setupediting anything. - Its up-arrow history is its own, in
%LOCALAPPDATA%\opal\bash_history. Ctrl+R still searches the commands of every shell. - Nothing is added to your PATH, and your other shells stay as they were. Inside Opal Bash the bundled tools come first, then your Windows PATH, so
git,node,pythonand other Windows programs work as usual. - Drives are
/c,/dand so on,/tmpis your Windows temp folder, and~is your Windows profile folder (orHOME, if you've set it).
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
- Tabs can be dragged to reorder, closed with a middle click, renamed and duplicated.
- Panes split right, down, or along the longer side, with dividers you can drag or move from the keyboard. A pane can be zoomed to fill the tab.
- Broadcast mode sends what you type to every pane in the tab.
- A pane closes when its shell exits normally. When it exits with an error, the pane stays open with the exit code, and Enter starts the shell again.
Following your commands
With opal's prompt, the terminal knows where each command starts and ends:
- a mark in the gutter next to each command, colored by its exit status;
- Ctrl+Up and Ctrl+Down jump between prompts;
- Ctrl+Shift+E selects the last command's output, and the command palette can copy it;
- clicking inside the command you're typing moves the shell's cursor there;
- when a command that ran longer than 10 seconds (
notify_after) finishes in a background tab or an unfocused window, the tab gets a note and you get a desktop notification. On Windows the taskbar button also flashes.
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
- Find in scrollback (Ctrl+Shift+F), with case and regex toggles.
- Select by character, word (double-click), line (triple-click) or block (Alt+drag). Copy on select is optional. Ctrl+C copies when text is selected and interrupts the program when nothing is.
- Ctrl+click opens links, both OSC 8 hyperlinks and plain URLs in the text.
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
- Colors come from the opal theme, so the terminal matches the prompt.
themeandbackgroundunder[terminal]give it a different one, individual colors and the 16-color palette can be overridden, andmin_contrastlifts text that's hard to read on its background. - Font fallback covers CJK, color emoji and the Nerd Font icons the prompt uses.
- Box drawing, block elements, braille and powerline separators are drawn from their shapes instead of the font, so they line up without gaps at any size.
- The emulation follows xterm: scrollback that reflows when the window is resized, true color, curly and colored underlines, emoji sequences as one character, bracketed paste, mouse reporting, the kitty keyboard protocol and synchronized output.
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.
| Action | Windows and Linux | macOS |
|---|---|---|
| New tab, new window | Ctrl+Shift+T, Ctrl+Shift+N | Cmd+T, Cmd+N |
| Close the pane | Ctrl+Shift+W | Cmd+W |
| Next, previous tab | Ctrl+Tab, Ctrl+Shift+Tab | Ctrl+Tab, Ctrl+Shift+Tab |
| Tab 1 to 9 | Ctrl+Alt+1 to 9 | Cmd+1 to 9 |
| Split right, down | Alt+Shift+Plus, Alt+Shift+Minus | Cmd+D, Cmd+Shift+D |
| Split along the longer side | Alt+Shift+D | palette |
| Move between panes | Alt+arrows | Cmd+Alt+arrows |
| Move a divider | Alt+Shift+arrows | Cmd+Ctrl+arrows |
| Zoom the pane | Ctrl+Shift+Z | Cmd+Shift+Enter |
| Copy, paste | Ctrl+Shift+C, Ctrl+Shift+V (also Ctrl+V on Windows) | Cmd+C, Cmd+V |
| Find | Ctrl+Shift+F | Cmd+F |
| Command palette | Ctrl+Shift+P | Cmd+Shift+P |
| Quick select | Ctrl+Shift+Space | Cmd+Shift+Space |
| Search history, recent folders | Ctrl+Shift+H, Ctrl+Shift+J | Cmd+Shift+H, Cmd+Shift+J |
| Previous, next prompt | Ctrl+Up, Ctrl+Down | Cmd+Up, Cmd+Down |
| Select the last command's output | Ctrl+Shift+E | palette |
| Font size | Ctrl+Plus, Ctrl+Minus, Ctrl+0 | Cmd+Plus, Cmd+Minus, Cmd+0 |
| Clear scrollback | Ctrl+Shift+K | Cmd+K |
| Full screen | F11 (also Alt+Enter on Windows) | Cmd+Ctrl+F |
| Broadcast input, rename the tab | Ctrl+Shift+I, Ctrl+Shift+R | Cmd+Shift+I, Cmd+Shift+R |
| Settings | Ctrl+Comma | Cmd+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.