See also Zsh

iTerm2

iTerm2 是 macOS 原生终端的替代品,也是 iTerm 的继承者。它适用于 macOS 10.12或更新版本的mac电脑。iTerm2 将终端带入了现代时代,其特性是你自己都不知道的自己想要的特性。

1. Usage

https://iterm2.com/documentation.html

# Install iTerm2
brew cask install iterm2
# download theme colors
wget wget https://github.com/mbadolato/iTerm2-Color-Schemes/raw/master/schemes/Solarized%20Dark%20-%20Patched.itermcolors
wget https://github.com/mbadolato/iTerm2-Color-Schemes/raw/master/schemes/midnight-in-mojave.itermcolors

1.1. Preferences

https://iterm2.com/documentation-preferences.html

1.1.1. Profiles > Text

1.1.2. Profiles > Window

1.1.3. Keys

See also https://iterm2.com/documentation-hotkey.html

1.2. Scripting

1.2.1. Running a Script

pip install pyobjc

# 脚本目录
cd ~/Library/ApplicationSupport/iTerm2/Scripts
# 自动运行的脚本的目录
cd ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch

1.2.2. Example Scripts

2. Skills

2.1. Session Restoration

https://www.iterm2.com/documentation-restoration.html

save tabs in iTerm 2 and restore next time

2.2. Tab Title Customization

Cmd + 
I, 手动修改 Tab 标题

使用 Script, ssh 后主动把 Tab 设置成 hostname

3. Reference


CategorymacOS