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.

Advantage

  • Support tmux, including tmux normal mode, and tmux command mode integrated with iTerm2.
  • Support transfer directories, trz -d to upload directories, tsz -d xxx to download xxx directories.
  • Support Windows server, not only can run on Windows client, but also can run on Windows ssh server.
  • Support native terminal, does not require terminal to support, just use trzsz ssh x.x.x.x to login.
  • Support web terminal, transfer files and directories between local and remote servers over the web.
  • Support drag to upload, drag and drop files and directories to the terminal to upload to the remote server.
  • Support progress bar, shows the current transferring file name, progress, size, speed, remaining time, etc.
  • Better interactive experience, shows the transfer results or errors friendly, ctrl + c to stop gracefully.

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
    
  • with Node.js

    sudo npm install -g trzsz
    
  • or install trzsz written in Go

    Check https://github.com/trzsz/trzsz-go

  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] [-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: 20)

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: 20)

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.
  • 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 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.1.2.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

trzsz_svr-1.1.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trzsz-svr-1.1.2.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for trzsz-svr-1.1.2.tar.gz
Algorithm Hash digest
SHA256 299440a5b3284a86ae9256b8d0cf9ac3e5ad9b23068319794c62963871a37e53
MD5 62f988bdc8d89dc1fea84c054d25703f
BLAKE2b-256 a2ef2740a48fe69e2086ad6119e0cee51ac56f217faec3de54ca4aa03bb1efff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trzsz_svr-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for trzsz_svr-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fde9b45eacff2d90532e8478f7d893ed3ba1367b1915a79760c8391c68340c19
MD5 a73b4535cffc9b0a6eca05d747197abf
BLAKE2b-256 56883b1748873cbfa2596654d211666ff195bf650f2df8a901d2e5f47b2f9f86

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