Skip to content

Instantly share code, notes, and snippets.

@jrejaud
Created February 23, 2026 16:20
Show Gist options
  • Select an option

  • Save jrejaud/f1d968b408149b020f290b4b3243bdfe to your computer and use it in GitHub Desktop.

Select an option

Save jrejaud/f1d968b408149b020f290b4b3243bdfe to your computer and use it in GitHub Desktop.
iTerm2 tab management setup - auto-updating names, status indicators, keyboard shortcuts
# iTerm2 Tab Management Setup
# Auto-updating tab names + status indicators + keyboard shortcuts
# 1. Load Oh My Zsh (includes termsupport hooks for tab name updates)
export ZSH="$HOME/.oh-my-zsh"
source $ZSH/oh-my-zsh.sh
# 2. Disable default auto-title (we'll use custom hooks instead)
DISABLE_AUTO_TITLE="true"
# 3. Custom tab title hooks (concise format)
precmd() {
# Called before displaying prompt - show directory only
print -Pn "\e]0;%~\a"
}
preexec() {
# Called before executing command - show command only
local cmd="${1%% *}"
print -Pn "\e]0;$cmd\a"
}
# 4. iTerm2 shell integration (enables status indicators, icons, ⌘N shortcuts)
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment