Bloodline's Blog Notes and thoughts from Bloodline

iTerm2配置 lrzsz

Comments

lrzsz 是 unix 下文件传输的工具,可以跟 iTerm2 进行配合。

brew install lrzsz

cd /usr/local/bin
sudo wget https://raw.github.com/mmastrac/iterm2-zmodem/master/iterm2-send-zmodem.sh
sudo wget https://raw.github.com/mmastrac/iterm2-zmodem/master/iterm2-recv-zmodem.sh
sudo chmod 777 /usr/local/bin/iterm2-*

打开 iTerm2,点击 preferences > profiles,选择某个默认的 profile,如 MyProfile,之后继续选择 advanced > 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

注意安装这个是在你本地的 Mac 环境中安装,不是在远程服务器上安装😑。

然后可以使用 sz、rz 命令了。