trzsz / trzsz-ssh

trzsz-ssh ( tssh ) is an ssh client designed as a drop-in replacement for the openssh client. It aims to provide complete compatibility with openssh, mirroring all its features, while also offering additional useful features. Such as login prompt, batch login, remember password, automated interaction, trzsz, zmodem(rz/sz), udp mode like mosh, etc.
https://trzsz.github.io/ssh
MIT License
1.68k stars 100 forks source link

用sh脚本的形式,trz上传窗口无法弹出 #132

Closed liaohongxing closed 2 months ago

liaohongxing commented 2 months ago

trzsz ssh 0.1.21

trz (trzsz) go 1.1.7

#!/bin/bash
tssh server1<<EOF
ls -la
trz
EOF

比如这段脚本, 出现 ::TRZSZ:TRANSFER:R:1.1.7:2187489899500:42563 就卡着,请问怎么操作能弹出选择文件窗口 。

lonnywong commented 2 months ago

为什么要这样做呢?

liaohongxing commented 2 months ago

需要将大量手动操作转为自动操作,上面两个命令只是例子 。比如上传一个 go 程序后,后面需要重启systemd , 重启关联服务等等

lonnywong commented 2 months ago

但是你要手工选文件这一步,也不是很自动吧。

如果能接受人工选文件,那你可以试试这样用:

tssh -t server1 'ls -la && trz'

你用管道的方式,tssh 是不会启用 trzsz 功能的,

liaohongxing commented 2 months ago

这个命令试了一下 ,也是无法弹出

lonnywong commented 2 months ago

还要加个 -t 参数。

liaohongxing commented 2 months ago

通过在sh脚本调用 tssh server1 -t "ls -la && trz" 这种形式可以正常工作。暂时解决问题

lonnywong commented 2 months ago

现已支持 --upload-file 参数在命令行中直接指定上传的文件,详看 https://github.com/trzsz/trzsz-ssh/issues/126#issuecomment-2254511555