Optimizing Your Terminal for AI Coding Assistants: Reduce Waiting and Context Switching
AI coding assistants often pause for permission approvals, leaving developers waiting or stuck switching between windows. This guide explains how to choose a capable terminal, configure Ghostty on macOS or Linux, and make AI session states visible through notifications, so you spend less time waiting and more time shipping.
Optimizing Your Terminal for AI Coding Assistants: Reduce Waiting and Context Switching
Prerequisites
This article is for developers who use CLI-based AI coding assistants on macOS or Linux. You should be able to open a terminal, edit plain-text configuration files, and know basic shell commands. The configuration examples are based on Ghostty; always check the official documentation for your specific version.
Why Do AI Coding Assistants Break Your Workflow?
AI assistants pause before actions that require authorization, such as modifying files or running commands. If you switch to your browser or editor to handle something else, you may return to find the assistant stuck on a permission prompt for a long time. These waits can erase the speed gains that AI provides.
Running multiple sessions in parallel adds to the burden. A typical project might run a frontend server, a backend server, logs, and an AI session at the same time—each in its own window or tab. It becomes hard to tell at a glance which session is waiting for input. Frontend developers also have to jump between the terminal, editor, and browser just to see how a page looks.
How to Choose a Terminal Emulator
Terminal emulators vary significantly in capability. The table below compares common options—match it against your platform and workflow preferences.
| Tool | Platforms | Configuration | Split panes | Notification awareness |
|---|---|---|---|---|
| Ghostty | macOS, Linux | Plain-text key = value |
Yes | Relies on terminal notification sequences emitted by programs |
| WezTerm | macOS, Linux, Windows | Lua scripts | Yes | Relies on notification sequences or plugins |
| kitty | macOS, Linux | kitty.conf |
Yes (layouts) | Relies on notification sequences |
| iTerm2 | macOS | GUI and config files | Yes | Supports triggers and badges |
| tmux | Runs inside almost any terminal | tmux.conf |
Yes (panes) | Requires custom hooks |
Note that tmux is not a terminal emulator—it’s a session multiplexer that runs inside a terminal and can be combined with any of the emulators above. Some newer tools offer built-in browsers or multi-agent panels, but these features evolve quickly, so check the release notes for your version before deciding.
General recommendations: if you just want better fonts, split panes, and themes, Ghostty or kitty has a low configuration cost. If you want to script and programmatically control your interface, consider WezTerm. If you need sessions to survive disconnects on remote machines, add tmux as a complementary layer.
How to Make AI Session States Visible
Start by choosing a terminal that can receive terminal notifications, and confirm that your AI assistant emits notifications when requesting authorization or completing tasks. How the assistant triggers notifications is controlled by its own configuration—consult its documentation.
If your terminal can’t receive notifications, you can call a system notification command from the assistant’s completion callback. Example for macOS:
osascript -e 'display notification "AI assistant finished" with title "Coding Assistant"'
Before notifications appear, make sure your system settings allow the terminal app to send notifications.
How to Configure Ghostty
Ghostty’s configuration file lives at ~/.config/ghostty/config, with one key = value per line and # for comments. The example below uses macOS; the macos-titlebar-style option only works on macOS.
Back up your existing file before making changes. If the file doesn’t exist, the backup command silently skips:
mkdir -p ~/.config/ghosttycp ~/.config/ghostty/config ~/.config/ghostty/config.bak 2>/dev/null || true
Write the following to ~/.config/ghostty/config:
# Follow the system's automatic light/dark theme switchingtheme = dark:iTerm2 Dark Background,light:iTerm2 Light Background# Auto-integrate with the current shell for prompt and command enhancementsshell-integration = detect# Font: larger size with thickening for easier code readingfont-size = 12font-thicken = trueadjust-cell-height = 20%# Window: follow system appearance, preserve window state, translucent backgroundwindow-theme = systemwindow-save-state = alwaysbackground-opacity = 0.8macos-titlebar-style = transparent# Mouse and clipboard: copy on select; pass mouse events to the terminal while Shift is heldcopy-on-select = clipboardmouse-shift-capture = truemouse-hide-while-typing = true# Cursor: blinking bar stylecursor-style = barcursor-style-blink = true# Scrollback buffer in bytes (~8 MB) to retain longer logsscrollback-limit = 8388608# Quick terminal drops down from the top of the screenquick-terminal-position = top
After writing the file, check it for syntax errors. If the command isn’t found, your version is older and you can skip this step:
ghostty +validate-config
Then inspect the effective values to confirm the theme and font size match your expectations:
ghostty +show-config | grep -E '^(theme|font-size)'
On macOS, press Cmd+Shift+, to reload the configuration. If the shortcut doesn’t work, simply restart the terminal.
To restore the original configuration, run the following and then reload:
mv ~/.config/ghostty/config.bak ~/.config/ghostty/config
Troubleshooting Common Issues
Configuration changes don’t take effect. Make sure the file is named config with no extension and is located in the ~/.config/ghostty/ directory. Misspelled option names are silently ignored—use +show-config to verify.
Theme renders incorrectly or falls back to the default. Theme names must exactly match the built-in names, including case and spaces.
Shell integration isn’t working. Confirm your shell is bash, zsh, or fish, and that shell-integration is set correctly.
