Iterm2多窗口同时输入命令

可能很多人都遇到过类似的问题:使用 iTerm2 时打开了多个窗口,却在改动配置后需要在每个窗口依次执行 source 指令以激活改动的配置。

其实,iTerm2 支持向多窗口(当前打开的所有窗口)同时输入相同的指令。只需要输入快捷键 ⌘(command) + ⇧(shift) + i。默认会跳出告警提示窗口:

可以勾选 Suppress this message permanently 取消告警,并 OK 确认。这时每个窗口右上角都会出现图标 表示当前已激活向所有窗口输入指令。

关闭该功能的方式是再次输入快捷键 ⌘(command) + ⇧(shift) + i 即可。

iTerm 常用快捷键

  • ⌘(command) + t 新建tab页
  • ⌘(command) + d 水平分屏
  • ⌘(command) + 左右方向键 切换标签
  • ⌘(command) + ; 查看历史命令
  • ⌘(command) + ⇧(shift) + d 垂直分屏
  • ⌘(command) + ⇧(shift) + e 显示时间线
  • ⌘(command) + ⇧(shift) + h 查看剪贴板历史

  • ctrl + a 行首
  • ctrl + e 行尾