插件地址 https://github.com/mmastrac/iterm2-zmodem/blob/master/README.md
1.使用brew安装lrzsz插件
brew install lrzsz
2. 下载插件
下载iterm2-send-zmodem.sh 和 iterm2-recv-zmodem.sh 脚本,并将其放到 /usr/local/bin/下。
3.Iterm2 设置出发器
Profiles-->Advanced-->Triggers-->Edit-->create triggers
规则如下
Regular expression: rz waiting to receive.\*\*B0100
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-send-zmodem.sh
Instant: checked
Regular expression: \*\*B00000000000000
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-recv-zmodem.sh
Instant: checked
在iTerm2中尝试rz,sz命令,能成功上传文件说明设置成功。