agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/tools/iterm2/SKILL.md

iterm2

Skill15 starsChanged 2 months agoMITView on GitHub

Expert iTerm2 terminal assistance covering split panes, profiles, trigger alerts, tmux integration, and shell integration. Use when optimizing macOS terminal productivity and keyboard navigation.

  • Pipes a download into a shell

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use tmux -CC when working over SSH to retain persistent sessions with native macOS UI shortcuts.

    line 95
  2. Distinctive:

    Leave scrollback buffer unlimited on low-memory machines.

    line 102
  3. Distinctive:

    Use slow rendering drivers.

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

iTerm2

iTerm2 is an advanced terminal emulator for macOS, providing split panes, tmux integration, robust search, trigger automation, and customizable profiles.

When to Use

  • Advanced macOS Terminal Emulator: Multi-pane split terminals, session restoration, and custom profiles.
  • Shell Integration & Semantic Navigation: Jumping between shell prompts (Cmd+Up/Down) and viewing command exit codes.
  • tmux Control Mode Integration (tmux -CC): Seamless integration where tmux windows become native iTerm2 tabs.
  • Triggers & Automated Highlights: Highlighting error keywords, auto-logging passwords, and badges with dynamic status.

Quick Start

# Install iTerm2 Shell Integration for advanced prompt markers and status bar
curl -L https://iterm2.com/shell_integration/install_shell_integration.sh | bash

Useful Shortcuts:

  • Cmd+D: Split pane vertically
  • Cmd+Shift+D: Split pane horizontally
  • Cmd+Option+Arrow: Navigate between panes
  • Cmd+Shift+Enter: Maximize active pane

Core Concepts

Shell Integration Installation & Benefits

Enabling semantic prompt navigation and status codes:

# Install iTerm2 shell integration for zsh or bash
curl -L https://iterm2.com/shell_integration/install_shell_integration.sh | zsh

# In ~/.zshrc or ~/.config/fish/config.fish
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"

Features enabled:

  • Cmd + Shift + Up/Down: Jump directly between prompt commands.
  • Colored circle indicator showing command success (blue) or exit failure (red).
  • iterm2_set_user_var: Inject custom variables into badge or status bar.

tmux Integration via Control Mode (-CC)

Running remote persistent sessions as native local tabs:

# Connect to remote server and attach tmux session in control mode
ssh user@server.infra.internal -t "tmux -CC attach || tmux -CC new"

iTerm2 renders tmux windows as native tabs and panes with local mouse scrolling and clipboard integration.

Setting Dynamic Badges and Status Bars

Displaying active AWS profile or Git branch in the terminal background:

# Function to set iTerm2 badge dynamically
function iterm2_print_badge() {
  printf "\e]1337;SetBadgeFormat=%s\a" $(echo -n "$1" | base64)
}

# In prompt hook:
iterm2_print_badge "PROD | $(git branch --show-current)"

Common Patterns

Native Tmux Integration with iTerm2 Windows

Problem: Traditional tmux requires complex keyboard leader keys that conflict with terminal shortcuts.

Solution: Attach tmux in native iTerm2 control mode:

# Attach session; iTerm2 converts tmux windows into native GUI tabs
tmux -CC attach -t dev-session

Best Practices

Do:

  • Install and enable iTerm2 Shell Integration to jump between commands and capture exit statuses.
  • Use tmux -CC when working over SSH to retain persistent sessions with native macOS UI shortcuts.
  • Map Caps Lock to Control or Escape in macOS settings for ergonomic terminal navigation.
  • Export iTerm2 profile settings to a shared JSON file or dotfiles repository.

Don't:

  • Store plain passwords in iTerm2 password manager without system keychain encryption.
  • Leave scrollback buffer unlimited on low-memory machines; set buffer to 10,000-50,000 lines.
  • Use slow rendering drivers; enable GPU acceleration in Preferences -> Advanced -> GPU Rendering.

Troubleshooting

ErrorCauseSolution
Broken symbols or question marks in promptPowerline/Nerd font missing in terminal profile.Install a Nerd Font (e.g. JetBrainsMono Nerd Font) and select in iTerm2 Preferences > Profiles > Text.
Option key not working as Meta/Alt keyOption key sends special characters instead of Esc+.In Preferences > Profiles > Keys, set Left Option Key to Esc+.
Terminal bell beep annoyingAudio bell enabled by default.In Preferences > Profiles > Terminal, check Silence bell or flash screen.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.