One shell setup for zsh, bash, fish and PowerShell
opal gives every shell you use the same prompt, aliases, tab completion, suggestions and command history, from one config file, on Windows, macOS and Linux. It also has a terminal app of its own.
zsh ╭─◆ opal/internal/prompt on main ⇡1 +2 !1 ?3 took 3.2s ╰─❯ bash ╭─◆ opal/internal/prompt on main ⇡1 +2 !1 ?3 ◇ api ╰─❯ fish ╭─◆ opal/internal/prompt on main ⇡1 +2 !1 ?3 ✦ 1 ╰─❯ pwsh ╭─◆ opal\internal\prompt on main ⇡1 +2 !1 ?3 ✘ 127 not found ╰─❯
What it sets up
The same features in every shell, from the same config.
Prompt
Three themes with git status, command duration, exit codes, virtualenvs and SSH or root markers. The prompt symbol's color tells you which shell you're in.
Aliases and plugins
Git aliases and other plugins, written once and translated into each shell's own syntax.
Tab completion
Git branches, remotes and changed files, even in PowerShell, which has none of its own. Completions from docker, kubectl, gh and other tools are set up too.
Suggestions
Grey text completes what you're typing from your history. Press Tab or the Right arrow to take it.
Shared history
Every command from every shell goes into one history. Ctrl+R searches all of it, or just this folder or this shell.
Tools
j to jump between folders, open, clipboard, extract, ports, and pkg install for whatever package manager you have.
Written for each shell
opal is a single program. When a shell starts, opal init prints code written for that shell, so nothing is emulated.
- Aliases become fish abbreviations and PowerShell functions that pass on arguments and pipeline input.
- PowerShell's own aliases, like
gcandgl, are kept unless you choose otherwise. - Works with bash 3.2 on macOS as well as bash 5, and with Windows PowerShell 5.1 as well as PowerShell 7.
- The prompt never runs text from folder or branch names.
- Setup only edits a marked block in your startup files and keeps a backup.
# the git plugin's "gst" in each shell
# zsh and bash
alias -- gst='git status'
# fish
abbr -a -g -- gst 'git status'
# PowerShell
function global:gst {
if ($MyInvocation.ExpectingInput) { $input | git status @args }
else { git status @args }
}
Opal Terminal
opal also has a terminal app of its own. It reads the same config, uses the same theme, and knows where each command starts and ends from the marks opal's prompt sends.
- On Windows it comes with Opal Bash: bash with
ls,grep,sed,awkand the other Unix tools, set up with opal and kept apart from your other shells. - Tabs, split panes, and a command palette that also searches the history of every shell.
- Jump between prompts, select a command's output, and get a notification when a long command finishes in the background.
- Quick select copies a URL, path or git hash on screen when you type its label.
- Inline images through sixel, the kitty graphics protocol and iTerm2's image sequence.
- Tabs, panes and their recent output come back the next time you open it.
It's used on Windows today. The macOS and Linux builds pass their tests but haven't been tried on real machines yet.
About Opal Terminal# open it in this folder
opal terminal
# or with another shell, or a program
opal terminal -profile PowerShell
opal terminal htop
# ~/.config/opal/config.toml
[terminal]
font_size = 13
notifications = "unfocused"
Runs on
CI loads opal into each of these shells on every change.
Windows PowerShell 5.1, PowerShell 7, bash, and any shell in WSL.
zsh, the bash 3.2 that ships with macOS, newer bash, fish and PowerShell 7.
bash, zsh, fish and PowerShell 7, on x86_64 and ARM64.
Try it in a minute
One command installs opal and sets up every shell it finds. opal setup --remove takes it out again.