1. 安装lrzsz
brew install lrzsz
2. 安装执行脚本
脚本下载地址:https://github.com/zhenghaohong/rzsz
将iterm2-send-zmodem.sh
和iterm2-recv-zmodem.sh
保存到/usr/local/bin
目录下。
3. 给这两个文件可执行权限(必须)
chmod 777 /usr/local/bin/iterm2-send-zmodem.sh
chmod 777 /usr/local/bin/iterm2-recv-zmodem.sh
4. 设置Iterm2的Tirgger特性
设置Iterm2的Tirgger特性,Profiles->Open Profiles->EditProfiles->Advanced中的Tirgger
添加两条trigger,分别设置 Regular expression,Action,Parameters,Instant如下:
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
5. 安装完成
1、上传文件:rz
2、下载文件:sz filepath