Building a WezTerm Setup That Actually Fits How You Work

A complete, opinionated walkthrough of a real macOS terminal configuration — WezTerm, zsh, Powerlevel10k, and Atuin — with every line explained.


Most terminal setups are assembled by accretion: a snippet from a blog here, a Stack Overflow answer there, and eighteen months later there’s a .zshrc nobody dares touch. This post does the opposite. It takes a working WezTerm configuration and walks through it line by line — what each setting does, why it’s there, what has to be installed for it to work, and where the sharp edges are.

The two files involved are ~/.wezterm.lua (the terminal) and ~/.zshrc (the shell that runs inside it). They’re independent — WezTerm doesn’t know or care that you use zsh — but they’re configured together because that’s where the seams show.


Part 1: What to install

Everything here comes from Homebrew, which keeps upgrades sane:

bash

# the terminal itself
brew install --cask wezterm

# the font — required, wezterm will look wrong without a Nerd Font
brew install --cask font-meslo-lg-nerd-font

# shell layer
brew install powerlevel10k zsh-autosuggestions zsh-syntax-highlighting

# modern replacements for ls and cd
brew install eza zoxide

# shell history
brew install atuin

A note on the font: MesloLGS Nerd Font Mono is not a system font. It’s the patched variant of Menlo that adds the icon glyphs Powerlevel10k and eza --icons rely on. Without it you get boxes instead of branch icons and folder symbols. The --cask matters — brew install font-meslo-lg-nerd-font without it will fail, because fonts are casks, not formulae.

Two binaries in this setup — goose and opencode — aren’t installed via Homebrew here. They live in ~/.local/bin, which is why the shell config puts that directory on PATH early. If you’re not using AI coding agents, delete the corresponding launcher entries and move on; nothing else depends on them.

Version reality check: WezTerm’s stable channel moves slowly, and the current release is still 20240203 — February 2024 3. New features (like the show_close_tab_button_in_tabs option) land in nightly builds first 2. The configurations below work on stable unless explicitly noted.


Part 2: ~/.wezterm.lua, line by line

WezTerm’s config is a Lua script. It returns a table describing the terminal, and Lua’s anything-goes nature is both the strength (you can compute settings, loop over hosts, hook events) and the hazard (one syntax error and the entire file is silently discarded, reverting you to defaults).

The preamble

lua

local wezterm = require("wezterm")
local config = wezterm.config_builder()

The first line imports WezTerm’s Lua API — needed for anything beyond static values (event handlers, actions, callbacks). The second returns a config object via config_builder(), which is preferable to a bare {} because it validates field names and types as you assign them. Assign a typo’d key to a plain table and it’s silently ignored; assign it to a builder object and you get a loud error.

Typography

lua

config.font = wezterm.font("MesloLGS Nerd Font Mono")
config.font_size = 12

font() with a plain string accepts a font family name and falls back to sensible ligature behaviour. Size 12 is compact — most people land between 12 and 14 once the tab bar and window chrome are in play.

Tab bar

lua

config.enable_tab_bar = true
config.tab_bar_at_bottom = false
config.use_fancy_tab_bar = true
config.hide_tab_bar_if_only_one_tab = false
config.tab_and_split_indices_are_zero_based = true

This block is worth understanding as a unit, because the settings interact.

enable_tab_bar = true turns the bar on at all — trivial, but it’s the first thing people disable by accident when copying minimal configs.

tab_bar_at_bottom = false puts tabs at the top, macOS-style, rather than tmux-style at the bottom. Purely preference.

use_fancy_tab_bar = true is the consequential one. WezTerm has two tab bar renderers: a retro one drawn from text cells you style yourself, and a fancy one drawn by the GUI. Only the fancy bar shows a close button (×) on each tab. If you’ve ever wondered why your tabs have no X, this flag is why. The trade-off: the fancy bar ignores tab_bar_style customizations, so you lose control over the tab arrows and separators.

hide_tab_bar_if_only_one_tab = false keeps the bar visible even with a single tab. This pairs with window decorations below: the traffic-light buttons live in the tab bar, so hiding the bar would hide your close/minimise/zoom buttons too.

tab_and_split_indices_are_zero_based = true makes keyboard shortcuts number from 0 instead of 1. With this on, “activate tab 1” is the second tab. It’s the tmux convention (Ctrl-b 0), and it’s the kind of decision you should make once and never revisit — mixing conventions across a config causes real muscle-memory damage.

Window chrome

lua

config.window_decorations = "INTEGRATED_BUTTONS|RESIZE"
config.window_background_opacity = 0.8
config.macos_window_background_blur = 10

window_decorations is a flag set, not an enum. RESIZE keeps the window resizable (never remove it — the docs warn that dropping it breaks resizing and minimizing). INTEGRATED_BUTTONS removes the native title bar and moves the macOS traffic lights into the tab bar, giving a frameless look while keeping close/minimise/zoom accessible.

The alternative here is plain "RESIZE", which removes the title bar and the buttons entirely — you then close windows with ⌘W. Useful for a maximally clean look, less useful if you like a visible close button.

window_background_opacity = 0.8 makes the window 80% opaque, so terminal content behind it shows through. macos_window_background_blur = 10 blurs what’s behind, which is what makes transparency readable rather than a smudged mess.

One side effect worth knowing: WezTerm automatically disables the window shadow whenever opacity is below 1.0. If the window looks like it’s floating without depth, add |MACOS_FORCE_ENABLE_SHADOW to the decorations string.

The colour scheme

lua

config.colors = {
    foreground = "#CBE0F0",
    background = "#011423",
    cursor_bg = "#47FF9C",
    cursor_border = "#47FF9C",
    cursor_fg = "#011423",
    selection_bg = "#033259",
    selection_fg = "#CBE0F0",
    ansi = { ... },
    brights = { ... },
}

This is a hand-rolled “coolnight” palette — a very dark blue-teal background (#011423), soft off-white text (#CBE0F0), and a mint-green cursor. It reads as calm rather than high-contrast, which is the point for long sessions.

The structure matters more than the specific hex values:

KeyControls
foreground / backgroundDefault text and canvas
cursor_bg / cursor_fg / cursor_borderThe cursor block and the character under it
selection_bg / selection_fgSelected text
ansi[0–7]The eight standard colours programs use
brights[0–7]Their bold/high-intensity counterparts

The colours in ansi and brights are what ls, git diff, vim, and eza actually use. WezTerm doesn’t interpret them semantically — it just hands them to programs that request “colour 2” (green) or “bright colour 1” (bright red).

The one weakness in this palette: several brights entries are identical or near-identical to their ansi counterparts. ansi[0] and brights[0] are both #214969; ansi[7] and brights[7] are both #24EAF7; ansi[5] is #a277ff and brights[5] is #A277FF — the same colour with different capitalisation. The practical effect is that bold text and dim text can be indistinguishable, which hurts in diff output and in prompts that rely on intensity. Brightening the brights row by roughly 15% each would fix it without changing the character of the theme.

The launcher menu

lua

config.launch_menu = {
    { label = "Goose Session", args = { "/bin/zsh", "-lc", "goose session" } },
    { label = "Opencode Session", args = { "/bin/zsh", "-lc", "opencode" } },
    { label = "zsh", args = { "/bin/zsh", "-l" } },
}

launch_menu adds entries to WezTerm’s launcher — the popup menu of things you can start. Each entry is a label plus the command to run.

The args are the interesting part. "/bin/zsh", "-lc", "goose session" means: start zsh as a login shell (-l, so .zprofile runs and Homebrew’s paths are set) and execute the given command (-c). Without -l, the GUI’s minimal environment means goose won’t be found; without -c, zsh would just open and the command string would be ignored.

One consequence: when goose exits, the shell it was running in exits too, and the tab closes. If you’d rather land back at a prompt, change the command to "goose session; exec /bin/zsh -l".

The zsh entry is deliberate redundancy — a clean shell, no AI agent attached, one keystroke away.

SSH domains

lua

config.ssh_domains = {
    { name = "macmini", remote_address = "100.90.139.34" },
    { name = "casaos", remote_address = "100.122.246.45" },
    { name = "think", remote_address = "100.115.32.78" },
}

WezTerm is also a multiplexer, and a “domain” is a source of panes — local, SSH host, or a mux server. Defining ssh_domains explicitly does two things: it gives you named hosts you can wezterm connect macmini to, and it suppresses WezTerm’s default behaviour of auto-generating a domain for every Host entry in ~/.ssh/config.

That second effect is why this list is short. With ssh_domains unset, WezTerm behaves as though you’d written config.ssh_domains = wezterm.default_ssh_domains(), and a 25-host ssh config produces 25 menu entries plus their multiplexing variants. Declaring three hosts keeps the menus legible. Hosts outside the list remain reachable via wezterm ssh some-other-host.

The right-click launcher

lua

config.mouse_bindings = {
    {
        event = { Down = { streak = 1, button = "Right" } },
        mods = "NONE",
        action = wezterm.action.ShowLauncherArgs { flags = "LAUNCH_MENU_ITEMS" },
    },
}

config.keys = {
    {
        key = "g",
        mods = "CMD",
        action = wezterm.action.ShowLauncherArgs { flags = "LAUNCH_MENU_ITEMS" },
    },
}

ShowLauncher opens a menu of everything WezTerm can do: launch menu entries, domains, workspaces, tabs, and every command in the app’s repertoire. ShowLauncherArgs is the scoped version — you must explicitly list each category you want, and anything unlisted is omitted.

With flags = "LAUNCH_MENU_ITEMS", the menu contains exactly the three entries defined above. No SSH hosts, no “Create new Workspace”, no forty lines of “Copy to clipboard / Paste from clipboard / Increase font size”. Just: pick one, press Enter.

The button = "Right" with mods = "NONE" covers both a real right-click and a trackpad two-finger tap. Down with streak = 1 means “on the first press, not a double-click”.

Adding a keys binding for the same action is straightforward insurance — the menu is discoverable by key even when you forget the mouse gesture exists.

Caveat: inside programs that capture the mouse — vim, less, htop, and tmux with set -g mouse on — mouse events go to the application, not to your bindings. Right-click will silently do nothing useful there. Hold SHIFT while right-clicking to bypass the capture and reach WezTerm’s binding.


The agent inside the tab — Goose

Everything so far has been about getting to a prompt. This part is about what you type at it.

Goose is an open-source AI agent that runs on your own machine rather than in a browser tab. Block — the company behind Square and Cash App — released it in January 2025 as “codename goose,” and it has since moved to the Agentic AI Foundation under the Linux Foundation 3. It’s written in Rust and TypeScript, Apache-2.0 licensed, and it ships in three forms: a native desktop app, a full CLI, and an API/ACP server you can point other tools at 7. The repository moved with it, from block/goose to aaif-goose/goose 4.

What makes it different from a chat window is that it acts. It reads files, runs shell commands, edits code, calls APIs, and chains those actions together until a task is done — then shows you what it did. That’s the whole proposition, and it’s also the whole risk, which is why the permission system (below) matters more than any other setting.

What’s actually happening under the hood

A Goose session is a loop: your prompt plus a system prompt plus a tool catalogue go to a language model; the model replies with either text or a tool call; Goose executes the tool; the result goes back into the conversation. Repeat.

The tool catalogue comes from extensions — mostly MCP (Model Context Protocol) servers [^b462f4]. The built-in developer extension is the one you’ll use constantly: it provides shell execution, file read/write, and text editing. Others cover memory, GitHub, browsers, databases. You can add one for a single session:

bash

goose session --with-builtin developer
goose session --with-extension "npx -y @modelcontextprotocol/server-memory"
goose session --with-streamable-http-extension "http://localhost:8080/mcp"

Sessions persist in SQLite (sessions.db) rather than loose files, a change that landed in version 1.10 2. That’s what makes goose session --resume -n my-project meaningful: the conversation, the tool results, and the working state all come back.

This is the layer the terminal config was built for. Goose Session in the launcher menu, 1 on the keyboard, and you’re in a session that already knows the directory you were in.

Two ways to run a model: cloud or local

Goose is provider-agnostic, with a genuinely long provider list — Anthropic, OpenAI, Google, Bedrock, Azure, OpenRouter, Groq, Cerebras, xAI, GitHub Copilot, ChatGPT subscriptions, and roughly forty others 1. Configuration is either goose configure interactively or a few environment variables in ~/.config/goose/config.yaml ?.

The two modes are meaningfully different, not just differently priced.

Cloud (Claude, GPT, Gemini…)Local (Ollama, LM Studio…)
SetupAPI key, one commandInstall Ollama, pull a model, configure
CostPer tokenElectricity
PrivacyPrompts + file contents leave the machineNothing leaves the machine
Offline❌✅
Tool callingStrong — the hard part, done wellVariable; small models fail at it
SpeedFastDepends entirely on your hardware

The tool-calling row is the one that decides whether local works for you. Goose’s own documentation says it “relies heavily on tool calling capabilities and currently works best with Claude 4 models,” and points at the Berkeley Function-Calling Leaderboard as a guide [^07edfd#11-15]. Tool calling is not a nice-to-have here — it is the agent. A model that can chat fluently but emits malformed tool calls produces a session that reads well and does nothing, or worse, does the wrong thing.

The local setup, concretely

bash

brew install ollama
ollama pull qwen3:30b          # a large model — needs the RAM
ollama serve                   # or launch the Ollama app

Then point Goose at it — either through goose configure (choose Ollama, accept http://localhost:11434, pick the model [^07edfd#1299-1388]) or, as in this setup, purely through environment variables:

zsh

export GOOSE_PROVIDER="ollama"
export GOOSE_MODEL="qwen3:30b"
export GOOSE_INPUT_LIMIT=32768
export GOOSE_CONTEXT_LIMIT=32768
export GOOSE_AUTO_COMPACT_THRESHOLD=0.7
export GOOSE_MODE="smart_approve"
export GOOSE_CLI_SHOW_THINKING=1

The context trap worth knowing about. Ollama’s default context window is 4096 tokens, and a 4096-token window is far too small for an agent that stuffs tool definitions, file contents, and conversation history into every request. The symptom is specific and misleading: Goose starts ignoring .goosehints, forgets which extension it’s using, or “forgets” the task mid-run. The documented fix is OLLAMA_CONTEXT_LENGTH [^07edfd#1390-1392]:

zsh

export OLLAMA_CONTEXT_LENGTH=32768

Keep that consistent with whatever budget you give Goose itself. If Goose believes it has 32k and Ollama silently truncates at 4k, the failure looks like model stupidity rather than a configuration mismatch — and you’ll spend an evening blaming the model.

Permission modes are the other setting that matters. GOOSE_MODE takes four values 9:

ModeBehaviour
autoRuns every tool call without asking
approveAsks before each tool call
smart_approveAI judges which calls need approval; read-only operations run freely
chatNo tools at all — pure conversation

smart_approve is the sane default: it prompts on write tools — file edits, rm, cp, mv — and lets reads through [^5ed6f9]. auto means an agent with your shell and your filesystem and no supervision; technically impressive, occasionally catastrophic. And note the important caveat: there’s no sandbox underneath these modes. smart_approve prompts before shell commands but doesn’t prevent them — you can still approve anything, and auto skips the prompt entirely [^b865b8].

You can switch mid-session with /mode, and switch models without leaving the session:

text

/mode chat
/model
/model --provider anthropic claude-sonnet-4-5

Beyond chat: sessions, recipes, and shell integration

The CLI is richer than goose session, and three of its features are worth adopting early:

Named, resumable sessions keep a project’s context alive across days:

bash

goose session -n docker-version
goose session --resume -n docker-version
goose session list -w ~/Code          # what did I work on here?

Recipes turn a repeatable prompt into a file with parameters, so “review this diff for security issues” becomes a command rather than a paragraph you retype 2. They can be scheduled with cron syntax via goose schedule 2.

Terminal integration is the one that changes daily habits, and it belongs in the config you already have:

zsh

eval "$(goose term init zsh)"

That gives each shell a persistent Goose session via AGENT_SESSION_ID and creates two aliases: @goose and @g 2. Type @g why did that fail? at a prompt and it answers with your recent command history as context. No new tab, no re-explaining what you were doing. For “I ran a command and don’t understand the error,” this is the shortest path that exists.

Where Goose fits in this setup

The pieces connect like this:

ThingRole
WezTerm launcher entryOne keystroke to a session in the right tab
~/.zshrc env blockProvider, model, context, permissions
goose term init zsh@g at any prompt, in any tab
~/bin wrapper (optional)goose session; exec /bin/zsh -l so the tab survives

One operational note: Goose stores credentials in the system keyring, which on macOS can trigger a Keychain prompt. In unattended contexts — cron, a scheduled recipe, an ACP client with nobody at the keyboard — that prompt blocks forever. The escape hatch is GOOSE_DISABLE_KEYRING=1 plus the key supplied as an environment variable 2.

Debugging tip: goose info -v prints the version, the config file path, session storage location, and the environment variables actually in effect 2. When a setting “isn’t working,” run that first — it distinguishes “the variable is wrong” from “the variable was never read.”


Amendment to the ~/.zshrc section

Add Goose’s shell integration near the end, before the syntax-highlighting line:

zsh

# ---- goose terminal integration (@goose / @g aliases) ----
eval "$(goose term init zsh)"

# ---- syntax highlighting LAST ----
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Command completion is also worth enabling, since Goose’s flag surface is large:

zsh

eval "$(goose completion zsh)"

Note the ordering constraint again: syntax highlighting stays last.

Amendment to the final thoughts

One honest observation the earlier sections didn’t cover: the launcher entry and the environment block solve different problems, and only the launcher is visible. A right-click menu that opens a Goose session is delightful and self-documenting. GOOSE_MODE=smart_approve sitting in .zshrc is invisible — and it’s the line that decides whether an autonomous agent can rm -rf your working directory without asking. Treat the permission mode as the most important setting in the file, not an afterthought next to a model name. auto is a decision to make deliberately, for a scoped task, ideally in a throwaway directory.

The second observation: local models make this setup private but not free in the way people expect. qwen3:30b is a demanding model; sustained agent sessions will make the fans audible and the battery disappear. The realistic split is to keep a large local model for work that must not leave the machine and a cloud model for long agentic runs where tool-calling reliability matters more than privacy. Goose’s /model --provider makes switching a one-line affair, which is exactly the flexibility the provider-agnostic design buys you.


Part 3: ~/.zshrc, line by line

The shell config is doing more work than the terminal config, and it’s where the order of operations actually matters.

Instant prompt

zsh

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

Powerlevel10k can render a usable prompt before your .zshrc finishes running, so the shell feels instant even when startup logic takes a second. This block — which must stay at the very top of the file — loads that cached prompt.

The constraint: anything that prints to the console during startup breaks it, producing a [WARNING]: Console output during zsh initialization detected message. That’s why tools like fastfetch or a “welcome” banner have to be placed above this block, or wrapped in a conditional that keeps them quiet.

Environment

zsh

export PATH="/Users/davidfield/.local/bin:$PATH"
export LIBVIRT_DEFAULT_URI="qemu:///system"

~/.local/bin prepended to PATH is where user-installed binaries land when a tool’s install script doesn’t use Homebrew — goose among them. Prepending (rather than appending) means these binaries win over system versions.

LIBVIRT_DEFAULT_URI tells libvirt-based tools (virsh, vagrant-libvirt) to talk to the system-wide QEMU daemon rather than the per-user one. It saves passing --connect qemu:///system on every invocation. If you don’t run VMs, this line is inert.

The Goose block

zsh

export GOOSE_PROVIDER="ollama"
export GOOSE_MODEL="qwen3:30b"
export GOOSE_INPUT_LIMIT=32768      # → Ollama num_ctx
export GOOSE_CONTEXT_LIMIT=32768    # → Goose's own budget/compaction math
export GOOSE_AUTO_COMPACT_THRESHOLD=0.7
export GOOSE_MODE="smart_approve"
export GOOSE_CLI_SHOW_THINKING=1

These point the Goose agent at a locally hosted model via Ollama instead of a cloud API — no key, no per-token cost, no data leaving the machine. The model is qwen3:30b, which is a large local model; expect it to want a lot of unified memory.

The two context settings deserve a note, because they’re the most common source of confusion when running local models. GOOSE_INPUT_LIMIT translates into Ollama’s num_ctx — the actual window size the model allocates. GOOSE_CONTEXT_LIMIT is Goose’s own accounting for when to start compacting the conversation. If the first is smaller than the second, Goose will think it has room it doesn’t have and the model will silently truncate; keeping them equal, as here, avoids that class of bug. GOOSE_AUTO_COMPACT_THRESHOLD=0.7 triggers compaction at 70% utilisation, leaving headroom for the reply.

GOOSE_MODE="smart_approve" is the permission posture: the agent can run low-risk commands unattended but pauses for anything destructive. GOOSE_CLI_SHOW_THINKING=1 surfaces the model’s reasoning tokens in the terminal — useful for debugging, noisy for daily use.

Powerlevel10k

zsh

source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

The first line loads the theme from Homebrew’s shared directory (the Apple Silicon prefix is /opt/homebrew; Intel Macs use /usr/local). The second loads your saved configuration — the prompt layout, segments, and colours chosen during p10k configure.

The [[ ! -f ... ]] || guard means “source it if it exists, do nothing if it doesn’t” — so a fresh machine doesn’t error before you’ve generated a config.

History

zsh

HISTFILE=$HOME/.zhistory
SAVEHIST=1000
HISTSIZE=999
setopt share_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_verify
bindkey '^[[A' history-search-backward
bindkey '^[[B' history-search-forward

HISTFILE relocates the history file to ~/.zhistory instead of the default ~/.zsh_history — a common convention, no functional difference.

HISTFILE + SAVEHIST + HISTSIZE define persistence: how many commands are kept across sessions, and how many are held in memory. SAVEHIST=1000 and HISTSIZE=999 are small — roughly a week of moderate use. The usual settings are 50,000 or more; zsh handles that size without noticeable cost. Also note the odd inversion: HISTSIZE (in-memory) is smaller than SAVEHIST (on-disk), so the in-memory ring drops entries the file still holds.

The setopt lines:

  • share_history — commands typed in one terminal appear in the history of every other one immediately
  • hist_expire_dups_first — when trimming, remove duplicates before removing unique entries
  • hist_ignore_dups — don’t record the same command twice in a row
  • hist_verify — expand !! and !$ into the buffer for review rather than executing instantly

The two bindkey lines make Up/Down search by prefix instead of stepping through history one entry at a time. Type git and press Up, and you cycle only through commands starting with git. This is the single highest-value shell tweak in most setups.

Plugins

zsh

source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

zsh-autosuggestions shows greyed-out completions from history as you type, accepted with → (or Ctrl-E). zsh-syntax-highlighting colours the command line live — red for a typo or missing binary, green for a valid one, underlined paths that exist.

Order matters: syntax highlighting must be sourced last, after everything else that wraps ZLE widgets. If another plugin loads after it, highlighting can break for that plugin’s widgets. Keep this as the final source line in the file.

File listing and navigation

zsh

alias ls="eza --icons=always"
eval "$(zoxide init zsh)"
alias cd="z"

eza is a modern ls with git status, tree view, and icons. --icons=always requires that Nerd Font — this is where the font install pays off.

zoxide is a frecency-ranked cd. You cd around normally for a week, then z proj jumps to the most-used directory matching “proj”. eval "$(zoxide init zsh)" installs the z command (and zi for an interactive picker).

alias cd="z" is where opinions split. It means every cd goes through zoxide, which handles absolute paths and existing directory names fine — but breaks cd - (previous directory) and makes cd with no arguments behave differently. If you rely on either, drop the alias and use z explicitly.

Atuin

zsh

. "$HOME/.atuin/bin/env"
eval "$(atuin init zsh)"

The first line is wrong if you installed Atuin via Homebrew. ~/.atuin/bin/env is created by Atuin’s shell installer, which puts the binary in ~/.atuin/bin 1. Homebrew installs it into /opt/homebrew/bin, already on PATH. On a Homebrew install that line either fails silently (guarded, if you wrap it in a file test) or errors on every new shell. Delete it.

The second line is the one that matters. Atuin replaces zsh’s history mechanism with a SQLite database that records command, directory, exit code, duration, and timestamp — and exposes it through a full-text search UI bound to Ctrl-R 1. Because it’s SQLite rather than a flat file, you can search by directory (“what did I run in this repo last week?”), filter out failures, and optionally sync across machines.

Install path caveat: Atuin’s own documentation recommends the curl installer, which sets everything up automatically 1. If you install manually — Homebrew, cargo, MacPorts — “merely installing the binary isn’t sufficient,” and you must add the shell plugin yourself 1. And if you installed via the script, upgrades come from atuin update; if via Homebrew, from brew upgrade 1. Don’t mix the two.

The one genuine conflict

Your existing bindkey '^[[A' history-search-backward and atuin init zsh fight over the Up arrow. Atuin binds Up to its search widget by default, and because the eval runs after the bindkey lines, Atuin wins — silently. Type git and press Up, and instead of a prefix search you get an interactive popup.

Both behaviours are defensible; having both intended and one silently winning is not. Pick one:

zsh

# Option A — keep Atuin on Ctrl-R only, restore prefix search on Up
eval "$(atuin init zsh --disable-up-arrow)"

# Option B — let Atuin own Up as well, and delete the two bindkey lines

--disable-up-arrow is the widely used fix for exactly this, and it’s the setup most people land on 4. Deleting the bindkey lines achieves the opposite and is equally valid — Atuin’s popup is a superset of a prefix search.

A corrected ~/.zshrc

Bringing the fixes together:

zsh

# ---- instant prompt (must stay at top) ----
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# ---- environment ----
export PATH="$HOME/.local/bin:$PATH"
export LIBVIRT_DEFAULT_URI="qemu:///system"

# ---- goose + local ollama ----
export GOOSE_PROVIDER="ollama"
export GOOSE_MODEL="qwen3:30b"
export GOOSE_INPUT_LIMIT=32768
export GOOSE_CONTEXT_LIMIT=32768
export GOOSE_AUTO_COMPACT_THRESHOLD=0.7
export GOOSE_MODE="smart_approve"
export GOOSE_CLI_SHOW_THINKING=1

# ---- prompt ----
source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

# ---- history ----
HISTFILE=$HOME/.zhistory
HISTSIZE=50000
SAVEHIST=50000
setopt share_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_verify

# ---- tools ----
alias ls="eza --icons=always"
eval "$(zoxide init zsh)"
alias cd="z"

# ---- autosuggestions (before atuin, so atuin can wrap widgets) ----
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh

# ---- atuin: ctrl-r search, up-arrow left to prefix search ----
eval "$(atuin init zsh --disable-up-arrow)"
bindkey '^[[A' history-search-backward
bindkey '^[[B' history-search-forward

# ---- syntax highlighting LAST ----
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Then, once, import the history you already have and (optionally) create a sync account:

bash

atuin import auto     # pull in existing ~/.zhistory
atuin register -u <user> -e <email>   # optional: encrypted cross-machine sync

Part 4: Theming, in layers

The theme in this setup isn’t one thing — it’s four, stacked:

  1. WezTerm’s colors table — the canvas, text, cursor, selection
  2. The ANSI palette — what programs think green and red look like
  3. Powerlevel10k’s ~/.p10k.zsh — prompt segment colours, which are 256-colour codes chosen at p10k configure time
  4. Atuin’s own theme — the search UI is a full-screen TUI with its own palette

Layer 2 is what breaks most attempts at a cohesive look. If you set a deep teal background but leave the default ANSI palette, ls output will be bright primary colours that clash with everything. The fix is to define all sixteen colours in config.colors, which is exactly what the coolnight block does.

Layer 3 is the one people forget. Powerlevel10k’s colours are set inside ~/.p10k.zsh as POWERLEVEL9K_*_FOREGROUND values — they don’t inherit from WezTerm’s palette. To make the prompt match the theme, run p10k configure with the “dark” preset and lean on green/teal accents, or hand-edit the colours in ~/.p10k.zsh to the same hex values used in config.colors.

Layer 4, Atuin: its appearance is controlled in ~/.config/atuin/config.toml, with style (compact, full, auto) and inline_height being the two settings that most change how invasive it feels. A compact, short popup is far less jarring than the full-screen replacement.

A note on PowerShell/theme alternatives: WezTerm ships with hundreds of named schemes (config.color_scheme = "Builtin Dark" etc.), and it’s worth browsing them before hand-rolling a palette — but a hand-rolled one that matches your prompt and your editor is the only way to get a genuinely unified look. This is what the coolnight block is.


Part 5: Where this setup breaks, and how to fix it

These are the failure modes that actually cost people hours:

The config silently stops working. A single Lua syntax error causes WezTerm to discard the entire file and run on defaults — no colours, no launcher, nothing. The tell: ⌘⇧L opens the Debug Overlay, whose Lua error section will show the parse failure. Do this before concluding “the setting doesn’t work.”

The launcher shows the wrong things. ShowLauncher includes every category. Only ShowLauncherArgs with explicit flags scopes it down. If your scoped menu still shows domains and commands, an older ShowLauncher binding is still present and winning.

Right-click does nothing in vim/tmux. Mouse reporting steals the event. Hold SHIFT.

command not found from a launcher entry. GUI-launched processes don’t inherit your interactive PATH. -l on the zsh invocation fixes most cases; hard-coding the binary’s full path fixes the rest.

Tabs have no close button. The × only exists in the fancy tab bar.

The prompt gets a console-output warning. Something printed during startup below the instant-prompt block. Move it above, or silence it with POWERLEVEL9K_INSTANT_PROMPT=quiet.


Final thoughts

What’s interesting about this configuration isn’t any single line — it’s that it treats the terminal as a launcher rather than a window. The launch_menu + right-click combination turns “what do I want to do” into a two-keystroke decision: right-click, press 1 for Goose, 2 for Opencode, 3 for a plain shell. That’s a better mental model than “open a terminal and type a command,” and it’s the kind of thing a terminal like Tabby markets as a feature while WezTerm just lets you configure.

The honest trade-offs:

WezTerm rewards config literacy and punishes config guessing. Everything here is possible in iTerm2 through a GUI, but the equivalent in WezTerm is ten lines of Lua you fully understand. The cost is that Lua errors fail silently and the documentation — while excellent — is enormous. Budget an evening.

The stable channel is stale. 20240203 is over two years old 3, and meaningful work happens in nightly builds 2. That’s fine for a terminal that already does everything, but it means some current documentation doesn’t apply to you, and you’ll occasionally find a blog post describing a feature you can’t use.

Three overlapping history mechanisms is one too many. This setup has zsh’s own history (HISTFILE, setopt share_history), a prefix search bound to Up, and Atuin’s SQLite-backed search bound to Ctrl-R. Atuin is strictly better at search; zsh’s history is still what !! and !$ operate on, so it can’t be removed entirely. The sensible end state is: Atuin for retrieval, zsh history for expansion, and Up-arrow behaviour chosen deliberately rather than decided by load order.

Small things worth fixing, in order of payoff:

  1. Fix the think SSH domain — 100.115.32.78 is a placeholder; verify the real address
  2. Drop . "$HOME/.atuin/bin/env" if Atuin came from Homebrew
  3. Add --disable-up-arrow (or delete the bindkey lines) to resolve the Up-arrow conflict
  4. Raise HISTSIZE/SAVEHIST to 50,000
  5. Brighten the brights row so bold text is distinguishable from normal
  6. Consider INTEGRATED_BUTTONS|RESIZE|MACOS_FORCE_ENABLE_SHADOW for depth under the translucency

None of those are urgent. The setup already works — that’s the point of documenting it. A terminal config is infrastructure, and infrastructure earns its keep by being boring, understood, and easy to change when the next tool comes along.


Sources

References (4 total)

  1. Installation – Atuin Docs docs.atuin.sh 70%
  2. Change Log – Wez’s Terminal Emulator wezterm.org 16%
  3. Download

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *