Mac iterm2支持rz、sz

ZModem integration for iTerm 2

This script can be used to automate ZModem transfers from your OSX desktop to a server that can run lrzsz (in theory, any machine
that supports SSH), and vice-versa.

The minimum supported iTerm2 version is 1.0.0.20120108

Troubleshooting

  • Sending a directory may fail: this is a known issue
  • If you are using tmux or some other terminal multiplexer (ie: screen), try using the -e option to sz and/or rz on your server to force escaping of more characters during transmission.
  • This tool may also fail if you are using expect or rlogin as it expects a mostly-clean 8-bit connection between the two parties.

Setup

  1. Install lrzsz on OSX: brew install lrzsz
  2. Save the iterm2-send-zmodem.sh and iterm2-recv-zmodem.sh scripts in /usr/local/bin/
  3. Set up Triggers in iTerm 2 like so:
    How to Create a Trigger

<pre>
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

</pre>

To send a file to a remote machine:

  1. Type rz on the remote machine
  2. Select the file(s) on the local machine to send
  3. Wait for the coprocess indicator to disappear

The receive a file from a remote machine

  1. Type sz filename1 filename2 … filenameN on the remote machine
  2. Select the folder to receive to on the local machine
  3. Wait for the coprocess indicator to disappear

Future plans (patches welcome)

  • Visual progress bar indicator

引用

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,943评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 11,540评论 0 23
  • 2017年9月17日星期日晴 以为昨天的大雨今天会很冷呢,但醒了就发现窗外的天好蓝云好白,这样的好天气当然...
    风筝2017阅读 298评论 0 0
  • 想想最近一周的状态,每天都很忙,除了工作就是吃饭睡觉。然而我感觉决定工作有很大一进步的就是一件事做好就能发生...
    小茨阅读 238评论 0 0
  • 丫头对她的生父并无多少印象,因为从娘胎里出来那会到现在跟他见面的次数就屈指可数,直至离婚后,那就更是少得可怜了,所...
    小奕瑾麻麻丶阅读 238评论 0 0

友情链接更多精彩内容