本文主要是介绍2023-mac rz sz 安装,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
之前安装过一次,没问题,这次按照之前教程装了就不管上传下载都会卡住;
step1:
brew install lrzsz
step2:在/usr/local/bin 路径下配置两个sh,之前从网上找到的直接用都不对,下面这个是调试过的正式可用的
iterm2-recv-zmodem.sh
#!/bin/bash
# Author: Matt Mastracci (matthew@mastracci.com)
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domainosascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; thenFILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
elseFILE=`osascript -e 'tell application "iTerm2" to activate' -e 'tell application "iTerm2" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
fiif [[ $FILE = "" ]]; thenecho Cancelled.# Send ZModem cancelecho -e \\x18\\x18\\x18\\x18\\x18sleep 1echoecho \# Cancelled transfer
elsecd "$FILE"/usr/local/bin/rz -E -e -bsleep 1echoechoecho \# Sent \-\> $FILE
fi
iterm2-send-zmodem.sh
#!/bin/bash
# Author: Matt Mastracci (matthew@mastracci.com)
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domainosascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; thenFILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
elseFILE=`osascript -e 'tell application "iTerm2" to activate' -e 'tell application "iTerm2" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
fi
if [[ $FILE = "" ]]; thenecho Cancelled.# Send ZModem cancelecho -e \\x18\\x18\\x18\\x18\\x18sleep 1echoecho \# Cancelled transfer
else/usr/local/bin/sz "$FILE" -e -bsleep 1echoecho \# Received $FILE
fi
step3: 建立软连接
sudo ln -s /opt/homebrew/bin/sz /usr/local/bin/sz
sudo ln -s /opt/homebrew/bin/rz /usr/local/bin/rz
step4: 配置
item2-preferences-profiles-advanced-triggers
配置信息:
rz配置参数
rz waiting to receive.\*\*B0100
Run Silent Coprocess
/usr/local/bin/iterm2-send-zmodem.sh
✅
✅sz配置参数\*\*B00000000000000
Run Silent Coprocess
/usr/local/bin/iterm2-recv-zmodem.sh
✅
✅
这篇关于2023-mac rz sz 安装的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!