← ClaudeAtlas

iterm2listed

Configure iTerm2 and exploit the features that distinguish it from other terminal emulators. Use for any iTerm2 request: "set iTerm2 as my default terminal", "change a profile or theme", "my iTerm setting keeps reverting", "add a dynamic profile", "version-control my iTerm config", "install shell integration", "set up triggers / status bar / hotkey window / badges / captured output", "why didn't my `defaults write` stick", or "what iTerm2 features am I not using". Covers the preferences model (why iTerm2 silently reverts scripted changes and how to write them safely), dynamic profiles, tracking the config in a dotfiles repo, shell integration and its utilities, the macOS default-terminal binding, and the power-feature catalog.
hsb3/dotfiles-agents · ★ 0 · AI & Automation · score 70
Install: claude install-skill hsb3/dotfiles-agents
# iTerm2 Two things make iTerm2 unlike other terminals to automate: it keeps its **entire** configuration in one plist that it rewrites from memory on quit, and its most valuable features are inert until shell integration is installed. Most "my iTerm setting won't stick" problems are the first; most "iTerm isn't better than Terminal.app" impressions are the second. ## The rule that governs every scripted change **iTerm2 overwrites its preferences from memory when it quits.** Any `defaults write com.googlecode.iterm2 …` made while iTerm2 is running is silently clobbered seconds later, when the user quits. There is no error and no warning. So: **quit iTerm2 before writing its preferences**, and guard every script that does so. Writing prefs from a terminal running *inside* iTerm2 cannot work — run it from Terminal.app or another emulator, or apply the change through the GUI. Two traps sit inside that guard, both of which produce a check that silently reports the opposite of the truth: ```bash # WRONG on both counts. if pgrep -xq iTerm2; then ... ``` - **`pgrep -x iTerm2` never matches.** pgrep compares against the full executable path (`/Applications/iTerm.app/Contents/MacOS/iTerm2`), so exact-match never fires. Plain `pgrep iTerm` is worse than useless: it matches the *helper* processes `iTermAI` and `iTermServer-<version>`, so it returns true when the app itself is closed. - **`ps … | grep -q` under `set -o pipefail` returns 141.** `grep -q` exits at the first ma