Skip to main content

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

MIT License PyPI trzsz 中文网站

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

  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] [-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
  -B N, --bufsize N  buffer chunk size ( 1K <= N <= 100M ). (default: 1M)
  -t N, --timeout N  timeout ( N seconds ) for each buffer chunk.
                     N <= 0 means never timeout. (default: 100)

tsz download files from the remote server

usage: tsz [-h] [-v] [-q] [-y] [-b] [-e] [-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
  -B N, --bufsize N  buffer chunk size ( 1K <= N <= 100M ). (default: 1M)
  -t N, --timeout N  timeout ( N seconds ) for each buffer chunk.
                     N <= 0 means never timeout. (default: 100)

Trouble shooting

  • If tmux is not running on the remote server, but on the local computer, or on a middle server.

    • Since trzsz can't find the tmux process on the server, have to use the tmux -CC control mode.
    • About how to use the tmux -CC control mode, please refer to iTerm2 tmux Integration.
  • If an error occurs, and trzsz is hanging up.

    • Press control + c to stop trz or tsz process on the server.
    • For iTerm2 users, press command + option + shift + r to stop iTerm2 Coprocesses.
  • If trz -b binary upload fails, and login to server using telnet or docker exec.

    • Try to escape all known control characters, e.g., trz -eb.
  • If trz -b binary upload fails, and the server is using Python3 < 3.7.

    • Python3 < 3.7 supports base64 mode, just don't use trz -b, use trz instead.
    • If you want to use trz -b binary upload, upgrade Python3 to 3.7 or higher, or use Python2.
  • If trz -b or tsz -b binary transfer fails, and login to server using expect.

    • Try to export LC_CTYPE=C before the expect script. e.g.:
      #!/bin/sh
      export LC_CTYPE=C
      expect -c '
        spawn ssh xxx
        expect "xxx: "
        send "xxx\n"
        interact
      '
      

Screenshot

Using trzsz in iTerm2 with text progress bar

using trzsz in iTerm2 with text progress bar

Using trzsz in iTerm2 with zenity progress bar

using trzsz in iTerm2 with zenity progress bar

Using trzsz in tabby with tabby-trzsz plugin

using trzsz in tabby with tabby-trzsz plugin

Contact

Feel free to email me lonnywong@qq.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trzsz-svr-1.0.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

trzsz_svr-1.0.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file trzsz-svr-1.0.0.tar.gz.

File metadata

  • Download URL: trzsz-svr-1.0.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for trzsz-svr-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1ea84d37e50d8afb2bd8a300b9c0fd26b496e8b3b919494f890a9e2cce3c1b73
MD5 2fada2a4a0439edd162b240de0b959d0
BLAKE2b-256 3f8a72a3acbdcbaba0a51c27fbc42cdfb5d125070186e37cf6c9bf39ac5de34a

See more details on using hashes here.

File details

Details for the file trzsz_svr-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: trzsz_svr-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for trzsz_svr-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fc030ce44036098c3beb14a4cd253654795ec29d23483b0f755e84f1228c105
MD5 95fe5e0349767654f9f0349383eaa763
BLAKE2b-256 36bcc4201834f942f11c6ffa3eea12f707e51488a555a107ff34b237190f1d5e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page