# 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/).
[](https://choosealicense.com/licenses/mit/)
[](https://pypi.python.org/pypi/trzsz-iterm2/)
[](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.

* Open `iTerm2 -> Preferences... / Settings... -> General -> Magic`, check `Enable Python API`.

* Set `ITERM2_COOKIE` environment variable for faster startup.
Open `iTerm2 -> Preferences... / Settings... -> Advanced`, filter by `COOKIE`, select `Yes`.

## Progress Bar
### Option 1: The cooler text progress bar
* Screenshot of text progress bar

* 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

* 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)
```

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/ea/f8/2d26c13f511116d8dea8f4bb4610144e4a85afee1b7ddfc96f4abfbead10/trzsz-iterm2-1.1.2.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[](https://choosealicense.com/licenses/mit/)\n[](https://pypi.python.org/pypi/trzsz-iterm2/)\n[](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 \n\n* Open `iTerm2 -> Preferences... / Settings... -> General -> Magic`, check `Enable Python API`.\n\n \n\n* Set `ITERM2_COOKIE` environment variable for faster startup.\n\n Open `iTerm2 -> Preferences... / Settings... -> Advanced`, filter by `COOKIE`, select `Yes`.\n\n \n\n\n## Progress Bar\n\n### Option 1: The cooler text progress bar\n\n* Screenshot of text progress bar\n \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 \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 \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.2",
"split_keywords": [
"trzsz",
"trz",
"tsz",
"lrzsz",
"rz",
"sz",
"tmux",
"iterm2",
"progressbar"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7160bf102b9d449797e5b15c10b2c090c9c710a19598f0b3f6896e337e4835eb",
"md5": "0618ec766cdf845c5789ec42573bdbc3",
"sha256": "567e1f2e90344c30bad3896002ec9c92267904c7834d4fbbb90e2bb6411b0700"
},
"downloads": -1,
"filename": "trzsz_iterm2-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0618ec766cdf845c5789ec42573bdbc3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 27045,
"upload_time": "2023-03-26T07:39:26",
"upload_time_iso_8601": "2023-03-26T07:39:26.001355Z",
"url": "https://files.pythonhosted.org/packages/71/60/bf102b9d449797e5b15c10b2c090c9c710a19598f0b3f6896e337e4835eb/trzsz_iterm2-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "eaf82d26c13f511116d8dea8f4bb4610144e4a85afee1b7ddfc96f4abfbead10",
"md5": "d022b3cc3be72f78ad884991e4fa7425",
"sha256": "5ba2600c9beff4a3e45d79341c944482c163a93ae418630884b212e5a09bb3bb"
},
"downloads": -1,
"filename": "trzsz-iterm2-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "d022b3cc3be72f78ad884991e4fa7425",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 19057,
"upload_time": "2023-03-26T07:39:27",
"upload_time_iso_8601": "2023-03-26T07:39:27.520372Z",
"url": "https://files.pythonhosted.org/packages/ea/f8/2d26c13f511116d8dea8f4bb4610144e4a85afee1b7ddfc96f4abfbead10/trzsz-iterm2-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-26 07:39:27",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "trzsz-iterm2"
}