Total Pageviews

Sunday 15 December 2019

iterm2-zmodem

在mac下,实现与服务器进行便捷的文件上传和下载操作.

步骤

1.安装支持rz和sz命令的lrzsz:brew install lrzsz
2.在本地/usr/local/bin/目录下保存iterm2-send-zmodem.sh 和iterm2-recv-zmodem.sh两个脚本
3.设置一下两个脚本的权限,一般 chmod 777 就行了
chmod 777 /usr/local/bin/iterm2-*
4.设置Iterm2的Tirgger特性,profiles->default->editProfiles->Advanced中的Tirgger
添加两条trigger,分别设置 Regular expression,Action,Parameters,Instant如下:
1.第一条
        Regular expression: rz waiting to receive.\*\*B0100
        Action: Run Silent Coprocess
        Parameters: /usr/local/bin/iterm2-send-zmodem.sh
        Instant: checked
2.第二条
        Regular expression: \*\*B00000000000000
        Action: Run Silent Coprocess
        Parameters: /usr/local/bin/iterm2-recv-zmodem.sh
        Instant: checked
from https://github.com/aikuyun/iterm2-zmodem
运行brew install lrzsz后,
在/usr/local/Cellar/lrzsz/0.12.20_1/bin/里面会生成如下的可执行文件:
lrb lrx lrz lsb lsx lsz rz sz