trzsz is a simple file transfer tools, similar to lrzsz ( rz / sz ) and compatible with tmux, which works with iTerm2 and has a nice progress bar.
Project description
trzsz
trzsz
( trz / tsz ) is a simple file transfer tools, similar to lrzsz
( rz / sz ), and compatible with tmux
.
Website: https://trzsz.github.io
Why?
Considering laptop -> hostA -> hostB -> docker -> tmux
, using scp
or sftp
is inconvenience.
In this case, lrzsz
( rz / sz ) is convenient to use, but unfortunately it's not compatible with tmux
.
tmux
is not going to support rz / sz ( 906, 1439 ), and creating a new tools is much easier than patching tmux
.
Installation
On the server
-
with Python3
sudo python3 -m pip install --upgrade trzsz
-
with Python2
sudo python2 -m pip install --upgrade trzsz
-
with Homebrew
brew update brew install trzsz
Can be installed without sudo
, just add the installation path ( e.g. ~/.local/bin
) to the PATH
environment.
Supported Terminals
-
iTerm2 -- check the trzsz-iterm2 installation.
-
tabby -- install the tabby-trzsz plugin.
-
electerm -- upgrade to
1.19.0
or higher. -
trzsz-go -- supports all terminals that support a local shell.
-
trzsz.js -- making webshell in browser and electron terminal supports
trzsz
.
Does your terminal supports trzsz
as well? Please let me know. I would love to have it on the list.
Trzsz Manual
trz
upload files to the remote server
usage: trz [-h] [-v] [-q] [-y] [-b] [-e] [-d] [-B N] [-t N] [path]
Receive file(s), similar to rz and compatible with tmux.
positional arguments:
path path to save file(s). (default: current directory)
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-q, --quiet quiet (hide progress bar)
-y, --overwrite yes, overwrite existing file(s)
-b, --binary binary transfer mode, faster for binary files
-e, --escape escape all known control characters
-d, --directory transfer directories and files
-B N, --bufsize N max buffer chunk size (1K<=N<=1G). (default: 10M)
-t N, --timeout N timeout ( N seconds ) for each buffer chunk.
N <= 0 means never timeout. (default: 10)
tsz
download files from the remote server
usage: tsz [-h] [-v] [-q] [-y] [-b] [-e] [-d] [-B N] [-t N] file [file ...]
Send file(s), similar to sz and compatible with tmux.
positional arguments:
file file(s) to be sent
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-q, --quiet quiet (hide progress bar)
-y, --overwrite yes, overwrite existing file(s)
-b, --binary binary transfer mode, faster for binary files
-e, --escape escape all known control characters
-d, --directory transfer directories and files
-B N, --bufsize N max buffer chunk size (1K<=N<=1G). (default: 10M)
-t N, --timeout N timeout ( N seconds ) for each buffer chunk.
N <= 0 means never timeout. (default: 10)
Trouble shooting
-
If
tmux
is not running on the remote server, but on the local computer, or on a middle server.- Option 1: Use
tmux -CC
integration with iTerm2, please refer to iTerm2 tmux Integration. - Option 2: Install trzsz-go on the local computer, and
alias ssh="trzsz ssh"
for convenience.
- Option 1: Use
-
If an error occurs, and
trzsz
is hanging up.- Press
control + c
to stoptrz
ortsz
process on the server. - For iTerm2 users, press
command + option + shift + r
to stop iTerm2 Coprocesses.
- Press
-
If
trz -b
binary upload fails, and login to server usingtelnet
ordocker exec
.- Try to escape all known control characters, e.g.,
trz -eb
.
- Try to escape all known control characters, e.g.,
-
If
trz -b
binary upload fails, and the server is usingPython3 < 3.7
.Python3 < 3.7
supports base64 mode, just don't usetrz -b
, usetrz
instead.- If you want to use
trz -b
binary upload, upgrade Python3 to 3.7 or higher, or use Python2.
-
If
trz -b
ortsz -b
binary transfer fails, and login to server usingexpect
.- Try to
export LC_CTYPE=C
before theexpect
script. e.g.:#!/bin/sh export LC_CTYPE=C expect -c ' spawn ssh xxx expect "xxx: " send "xxx\n" interact '
- Try to
Screenshot
Using trzsz in iTerm2 with text
progress bar
Using trzsz in iTerm2 with zenity
progress bar
Using trzsz in tabby with tabby-trzsz
plugin
Contact
Feel free to email me lonnywong@qq.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file trzsz-svr-1.1.0.tar.gz
.
File metadata
- Download URL: trzsz-svr-1.1.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 057ba12437f72e92b95087d6699ba9849d6f1a41286d9e9c7539a603d22a22fc |
|
MD5 | de2283d2d22048f547a07a4db679c79e |
|
BLAKE2b-256 | eb8239f3144bd3584f7ecc5f23fa5f929d5cba8135ec690bfcbceae02490448f |
File details
Details for the file trzsz_svr-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: trzsz_svr-1.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cab78e9bb87f411112454e2825808ca1651e3fd86d4b1da1e814dc95adf4d519 |
|
MD5 | f700b8ca4ad28aec82eaeb371378a1db |
|
BLAKE2b-256 | ead57a39f2239eb767c0e3890487f69e902a4836a24ce287e329445a2515319e |