# trzsz-iterm2
`trzsz` ( trz / tsz ) is a simple file transfer tools, similar to `lrzsz` ( rz / sz ), and compatible with `tmux`.
`trzsz-iterm2` is a client tool for [trzsz](https://trzsz.github.io/) used with [iTerm2](https://iterm2.com/).
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://choosealicense.com/licenses/mit/)
[![PyPI trzsz-iterm2](https://img.shields.io/pypi/v/trzsz-iterm2?style=flat)](https://pypi.python.org/pypi/trzsz-iterm2/)
[![中文网站](https://img.shields.io/badge/%E4%B8%AD%E6%96%87-%E7%BD%91%E7%AB%99-blue?style=flat)](https://trzsz.github.io/cn/iterm2)
## Installation
* With Python3
```
sudo python3 -m pip install --upgrade trzsz-iterm2
```
* With Homebrew
```
brew update
brew install trzsz
```
## Configuration
* Find out the absolute path where `trzsz-iterm2` is installed.
```sh
which trzsz-iterm2
```
Change the `/usr/local/bin/trzsz-iterm2` below to the real absolute path of `trzsz-iterm2`.
* Open `iTerm2 -> Preferences... / Settings... -> Profiles -> (select a profile on the left) -> Advanced -> Triggers -> Edit -> [+]`
| Name | Value | Note |
| ---- | ----- | ---- |
| Regular Expression | `:(:TRZSZ:TRANSFER:[SRD]:\d+\.\d+\.\d+:\d+)` | <!-- avoid triple click copy a newline --> No space at the end |
| Action | `Run Silent Coprocess...` | |
| Parameters | `/usr/local/bin/trzsz-iterm2 \1` | <!-- avoid triple click copy a newline --> No space at the end |
| Enabled | ✅ | Checked |
* Don't check the `Use interpolated strings for parameters` at the bottom.
* The `/usr/local/bin/trzsz-iterm2` should be changed to the real absolute path of `trzsz-iterm2`.
* Note that the `Triggers` should be configured for each `Profile` in use.
* `Triggers` allows multiple lines, but only shows one line. Make sure don't copy a newline into it.
![iTerm2 Trigger configuration](https://trzsz.github.io/images/config.jpg)
* Open `iTerm2 -> Preferences... / Settings... -> General -> Magic`, check `Enable Python API`.
![iTerm2 Enable Python API](https://trzsz.github.io/images/PythonAPI.png)
* Set `ITERM2_COOKIE` environment variable for faster startup.
Open `iTerm2 -> Preferences... / Settings... -> Advanced`, filter by `COOKIE`, select `Yes`.
![iTerm2 Enable ITERM2_COOKIE](https://trzsz.github.io/images/iterm2_cookie.png)
## Progress Bar
### Option 1: The cooler text progress bar
* Screenshot of text progress bar
![using trzsz in iTerm2 with text progress bar](https://trzsz.github.io/images/iterm2_text.gif)
* Upgrade iTerm2 to `Build 3.5.20220503-nightly` or higher.
* Add `-p text` to the parameters of iTerm2 `Trigger`.
```
/usr/local/bin/trzsz-iterm2 -p text \1
```
Don't forget to change `/usr/local/bin/trzsz-iterm2` to the real absolute path of `trzsz-iterm2`.
### Option 2: The [zenity](https://github.com/ncruces/zenity) progress bar
* Screenshot of zenity progress bar
![using trzsz in iTerm2 with zenity progress bar](https://trzsz.github.io/images/iterm2_zenity.gif)
* Install `zenity`
```sh
brew install ncruces/tap/zenity
```
* If `Mac M1` install fails, try to install it with `go`:
```sh
brew install go
go install 'github.com/ncruces/zenity/cmd/zenity@latest'
sudo cp ~/go/bin/zenity /usr/local/bin/zenity
```
* `ls -l /usr/local/bin/zenity` should shows the `zenity` executable file or link. If not, create a soft link:
```sh
sudo ln -sv $(which zenity) /usr/local/bin/zenity
```
* If the progress dialog doesn't pop up in front, try upgrade [zenity](https://github.com/ncruces/zenity), and don't check `iTerm2 -> Secure Keyboard Entry`.
## Default save path
If you want to automatically download files to the specified directory instead of asking each time.
e.g.: Automatically download files to `/Users/xxxxx/Downloads`
* Using text progress bar, change `/usr/local/bin/trzsz-iterm2 -p text \1` to:
```
/usr/local/bin/trzsz-iterm2 -p text -d '/Users/xxxxx/Downloads' \1
```
* Using zenity progress bar, change `/usr/local/bin/trzsz-iterm2 \1` to:
```
/usr/local/bin/trzsz-iterm2 -p zenity -d '/Users/xxxxx/Downloads' \1
```
Don't forget to change `/usr/local/bin/trzsz-iterm2` to the real absolute path of `trzsz-iterm2`.
## Dragging files and directories to upload
* Upgrade iTerm2 to `Build 3.5.20220806-nightly` or higher.
* Open `iTerm2 -> Preferences... / Settings... -> Advanced`, filter by `files are dropped into`, configure as:
```
/usr/local/bin/trzsz-iterm2 -p text dragfiles \(filenames)
```
![iTerm2 enable drag files](https://trzsz.github.io/images/drag_config.png)
Don't forget to change `/usr/local/bin/trzsz-iterm2` to the real absolute path of `trzsz-iterm2`.
Raw data
{
"_id": null,
"home_page": "https://trzsz.github.io",
"name": "trzsz-iterm2",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "trzsz trz tsz lrzsz rz sz tmux iTerm2 progressbar",
"author": "Lonny Wong",
"author_email": "lonnywong@qq.com",
"download_url": "https://files.pythonhosted.org/packages/84/a7/13d3f511f73dd0de5f7f3c2abda51a3fe5acd9cd0afcff5281570e3df1dc/trzsz-iterm2-1.1.4.tar.gz",
"platform": null,
"description": "# trzsz-iterm2\n\n`trzsz` ( trz / tsz ) is a simple file transfer tools, similar to `lrzsz` ( rz / sz ), and compatible with `tmux`.\n\n`trzsz-iterm2` is a client tool for [trzsz](https://trzsz.github.io/) used with [iTerm2](https://iterm2.com/).\n\n[![MIT License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://choosealicense.com/licenses/mit/)\n[![PyPI trzsz-iterm2](https://img.shields.io/pypi/v/trzsz-iterm2?style=flat)](https://pypi.python.org/pypi/trzsz-iterm2/)\n[![\u4e2d\u6587\u7f51\u7ad9](https://img.shields.io/badge/%E4%B8%AD%E6%96%87-%E7%BD%91%E7%AB%99-blue?style=flat)](https://trzsz.github.io/cn/iterm2)\n\n\n## Installation\n\n* With Python3\n ```\n sudo python3 -m pip install --upgrade trzsz-iterm2\n ```\n\n* With Homebrew\n ```\n brew update\n brew install trzsz\n ```\n\n## Configuration\n\n* Find out the absolute path where `trzsz-iterm2` is installed.\n ```sh\n which trzsz-iterm2\n ```\n Change the `/usr/local/bin/trzsz-iterm2` below to the real absolute path of `trzsz-iterm2`.\n\n* Open `iTerm2 -> Preferences... / Settings... -> Profiles -> (select a profile on the left) -> Advanced -> Triggers -> Edit -> [+]`\n\n | Name | Value | Note |\n | ---- | ----- | ---- |\n | Regular Expression | `:(:TRZSZ:TRANSFER:[SRD]:\\d+\\.\\d+\\.\\d+:\\d+)` | <!-- avoid triple click copy a newline --> No space at the end |\n | Action | `Run Silent Coprocess...` | |\n | Parameters | `/usr/local/bin/trzsz-iterm2 \\1` | <!-- avoid triple click copy a newline --> No space at the end |\n | Enabled | \u2705 | Checked |\n\n * Don't check the `Use interpolated strings for parameters` at the bottom.\n\n * The `/usr/local/bin/trzsz-iterm2` should be changed to the real absolute path of `trzsz-iterm2`.\n\n * Note that the `Triggers` should be configured for each `Profile` in use.\n\n * `Triggers` allows multiple lines, but only shows one line. Make sure don't copy a newline into it.\n\n ![iTerm2 Trigger configuration](https://trzsz.github.io/images/config.jpg)\n\n* Open `iTerm2 -> Preferences... / Settings... -> General -> Magic`, check `Enable Python API`.\n\n ![iTerm2 Enable Python API](https://trzsz.github.io/images/PythonAPI.png)\n\n* Set `ITERM2_COOKIE` environment variable for faster startup.\n\n Open `iTerm2 -> Preferences... / Settings... -> Advanced`, filter by `COOKIE`, select `Yes`.\n\n ![iTerm2 Enable ITERM2_COOKIE](https://trzsz.github.io/images/iterm2_cookie.png)\n\n\n## Progress Bar\n\n### Option 1: The cooler text progress bar\n\n* Screenshot of text progress bar\n ![using trzsz in iTerm2 with text progress bar](https://trzsz.github.io/images/iterm2_text.gif)\n\n* Upgrade iTerm2 to `Build 3.5.20220503-nightly` or higher.\n\n* Add `-p text` to the parameters of iTerm2 `Trigger`.\n ```\n /usr/local/bin/trzsz-iterm2 -p text \\1\n ```\n Don't forget to change `/usr/local/bin/trzsz-iterm2` to the real absolute path of `trzsz-iterm2`.\n\n### Option 2: The [zenity](https://github.com/ncruces/zenity) progress bar\n\n* Screenshot of zenity progress bar\n ![using trzsz in iTerm2 with zenity progress bar](https://trzsz.github.io/images/iterm2_zenity.gif)\n\n* Install `zenity`\n ```sh\n brew install ncruces/tap/zenity\n ```\n\n* If `Mac M1` install fails, try to install it with `go`:\n ```sh\n brew install go\n go install 'github.com/ncruces/zenity/cmd/zenity@latest'\n sudo cp ~/go/bin/zenity /usr/local/bin/zenity\n ```\n\n* `ls -l /usr/local/bin/zenity` should shows the `zenity` executable file or link. If not, create a soft link:\n ```sh\n sudo ln -sv $(which zenity) /usr/local/bin/zenity\n ```\n\n* If the progress dialog doesn't pop up in front, try upgrade [zenity](https://github.com/ncruces/zenity), and don't check `iTerm2 -> Secure Keyboard Entry`.\n\n\n## Default save path\n\nIf you want to automatically download files to the specified directory instead of asking each time.\n\ne.g.: Automatically download files to `/Users/xxxxx/Downloads`\n\n* Using text progress bar, change `/usr/local/bin/trzsz-iterm2 -p text \\1` to:\n ```\n /usr/local/bin/trzsz-iterm2 -p text -d '/Users/xxxxx/Downloads' \\1\n ```\n\n* Using zenity progress bar, change `/usr/local/bin/trzsz-iterm2 \\1` to:\n ```\n /usr/local/bin/trzsz-iterm2 -p zenity -d '/Users/xxxxx/Downloads' \\1\n ```\n\nDon't forget to change `/usr/local/bin/trzsz-iterm2` to the real absolute path of `trzsz-iterm2`.\n\n\n## Dragging files and directories to upload\n\n* Upgrade iTerm2 to `Build 3.5.20220806-nightly` or higher.\n\n* Open `iTerm2 -> Preferences... / Settings... -> Advanced`, filter by `files are dropped into`, configure as:\n ```\n /usr/local/bin/trzsz-iterm2 -p text dragfiles \\(filenames)\n ```\n\n ![iTerm2 enable drag files](https://trzsz.github.io/images/drag_config.png)\n\nDon't forget to change `/usr/local/bin/trzsz-iterm2` to the real absolute path of `trzsz-iterm2`.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "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.",
"version": "1.1.4",
"project_urls": {
"Homepage": "https://trzsz.github.io"
},
"split_keywords": [
"trzsz",
"trz",
"tsz",
"lrzsz",
"rz",
"sz",
"tmux",
"iterm2",
"progressbar"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b3077a58303ff754fc41a68a2a41c9daa987a30fddbd2dc143d6e0608e2c66a3",
"md5": "8bae1a1751ace53449c6b9f3475722d4",
"sha256": "6fd160cd704444787af739f1e0cf835a8b8274e57cde63dbb1ba43e596b29d46"
},
"downloads": -1,
"filename": "trzsz_iterm2-1.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8bae1a1751ace53449c6b9f3475722d4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 28496,
"upload_time": "2023-10-15T02:34:03",
"upload_time_iso_8601": "2023-10-15T02:34:03.279601Z",
"url": "https://files.pythonhosted.org/packages/b3/07/7a58303ff754fc41a68a2a41c9daa987a30fddbd2dc143d6e0608e2c66a3/trzsz_iterm2-1.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "84a713d3f511f73dd0de5f7f3c2abda51a3fe5acd9cd0afcff5281570e3df1dc",
"md5": "64ecacfde22b7a873377dd17ef2d1d42",
"sha256": "27898b478283e42011066ab52e388c8f4de662ebb61b0ebab5efd92223d8ce63"
},
"downloads": -1,
"filename": "trzsz-iterm2-1.1.4.tar.gz",
"has_sig": false,
"md5_digest": "64ecacfde22b7a873377dd17ef2d1d42",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 19620,
"upload_time": "2023-10-15T02:34:04",
"upload_time_iso_8601": "2023-10-15T02:34:04.862625Z",
"url": "https://files.pythonhosted.org/packages/84/a7/13d3f511f73dd0de5f7f3c2abda51a3fe5acd9cd0afcff5281570e3df1dc/trzsz-iterm2-1.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-15 02:34:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "trzsz-iterm2"
}