{"id":16615666,"url":"https://github.com/pschmitt/tmux-ssh-split","last_synced_at":"2025-04-07T05:09:20.953Z","repository":{"id":43429987,"uuid":"268024686","full_name":"pschmitt/tmux-ssh-split","owner":"pschmitt","description":"TMUX plugin to split the current pane while retaining SSH connections","archived":false,"fork":false,"pushed_at":"2025-03-23T21:56:16.000Z","size":167,"stargazers_count":89,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T04:05:28.182Z","etag":null,"topics":["cli","mosh","ssh","terminal","tmux"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pschmitt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["pschmitt"],"custom":["https://www.paypal.com/paypalme/pppschmitt"]}},"created_at":"2020-05-30T06:43:31.000Z","updated_at":"2025-03-23T21:56:20.000Z","dependencies_parsed_at":"2023-12-02T22:22:04.422Z","dependency_job_id":"27a0da24-d9fe-4338-aa72-bc16a5f02efd","html_url":"https://github.com/pschmitt/tmux-ssh-split","commit_stats":{"total_commits":86,"total_committers":4,"mean_commits":21.5,"dds":"0.046511627906976716","last_synced_commit":"d43b4722ce37138f8d391b77396f4754782f33ee"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Ftmux-ssh-split","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Ftmux-ssh-split/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Ftmux-ssh-split/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschmitt%2Ftmux-ssh-split/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pschmitt","download_url":"https://codeload.github.com/pschmitt/tmux-ssh-split/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595334,"owners_count":20963943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","mosh","ssh","terminal","tmux"],"created_at":"2024-10-12T02:10:17.771Z","updated_at":"2025-04-07T05:09:20.930Z","avatar_url":"https://github.com/pschmitt.png","language":"Shell","funding_links":["https://github.com/sponsors/pschmitt","https://www.paypal.com/paypalme/pppschmitt"],"categories":[],"sub_categories":[],"readme":"# 🎛️ TMUX SSH Split\n\n[![](./tmux-ssh-split.gif)](https://asciinema.org/a/335250)\n\nThis TMUX plugin is a modern iteration of the concept\n[sshh](https://github.com/yudai/sshh)\nintroduced.\n\nIt enables seamless SSH\nsplits. If you're in an SSH session in the current pane and press the designated\nkey combination, the pane will split, and the newly created pane will host an\nSSH session connected to the host you were previously on. If there's no active\nSSH session, a regular split will occur.\n\n💡 NOTE: mosh works too to some extent (experimental)\n\n## 📥 Installation\n\nYou can install this plugin using [TPM](https://github.com/tmux-plugins/tpm):\n\n```\nset -g @plugin 'pschmitt/tmux-ssh-split'\n```\n\n## 🛠️ Configuration\n\nTo use this plugin, you need to set at least one of the `ssh-split-h-key`\nor `ssh-split-v-key` options. These keys (`PREFIX + key`) will be bound to\nhorizontal and vertical splits, respectively.\n\n## ⚙️ Options\n\n| Option                       | Description                                                                                                                                                                                                                                                                                                                                                              | Default Value |\n| ---                          | ---                                                                                                                                                                                                                                                                                                                                                                      | ---           |\n| `@ssh-split-h-key`           | Key to bind for horizontal splits (prefixed)                                                                                                                                                                                                                                                                                                                             | *none*        |\n| `@ssh-split-v-key`           | Key to bind for vertical splits (prefixed)                                                                                                                                                                                                                                                                                                                               | *none*        |\n| `@ssh-split-w-key`           | Key to bind for new windows (prefixed)                                                                                                                                                                                                                                                                                                                                   | *none*        |\n| `@ssh-split-keep-cwd`        | Determines whether the starting directory of the new pane should be the same as the current pane. This is similar to executing `tmux split -c \"#{pane_current_path}\"`.                                                                                                                                                                                                   | `false`       |\n| `@ssh-split-keep-remote-cwd` | Similar to the above, but for remote (SSH) splits. Note that remote path detection requires an [OSC7 prompt](https://wezfurlong.org/wezterm/shell-integration.html#osc-7-escape-sequence-to-set-the-working-directory) and falls back to PS1 parsing, so it won't work if your prompt doesn't contain the current path. This works best with `@ssh-split-strip-cmd=true` | `false`       |\n| `@ssh-split-fail`            | Determines whether to do nothing if the current pane isn't running SSH. By default, a normal split will occur.                                                                                                                                                                                                                                                           | `false`       |\n| `@ssh-split-no-env`          | If set to true, this will not set `TMUX_SSH_SPLIT=1` in splits (see tips and tricks section)                                                                                                                                                                                                                                                                             | `false`       |\n| `@ssh-split-no-shell`        | If set to true, this will prevent a shell session from spawning after the SSH session, causing the pane to exit when the SSH session ends.                                                                                                                                                                                                                               | `false`       |\n| `@ssh-split-strip-cmd`       | If set to true, the SSH command executed in the new pane will be stripped of the remote command portion. For example, if you're running `ssh HOST COMMAND` in a pane and you split it, tmux-ssh-split will create a new pane with a start command of `ssh HOST`.                                                                                                         | `false`       |\n| `@ssh-split-verbose`         | Displays a message before the SSH command is spawned with the command being executed                                                                                                                                                                                                                                                                                     | `false`       |\n| `@ssh-split-debug`           | Debug mode. Redirects the script output to `/tmp/tmux-ssh-split.log` (or `$TMPDIR/tmux-ssh-split.log` if `TMPDIR` is defined).                                                                                                                                                                                                                                           | `false`       |\n\n### 💡 Example config\n\n```\nset-option -g @ssh-split-keep-cwd \"true\"\nset-option -g @ssh-split-keep-remote-cwd \"true\"\nset-option -g @ssh-split-fail \"false\"\nset-option -g @ssh-split-no-env \"false\"\nset-option -g @ssh-split-no-shell \"false\"\nset-option -g @ssh-split-strip-cmd \"true\"\nset-option -g @ssh-split-verbose \"true\"\nset-option -g @ssh-split-debug \"false\"\nset-option -g @ssh-split-h-key \"|\"\nset-option -g @ssh-split-v-key \"S\"\nset-option -g @ssh-split-w-key \"C\"\n\nset -g @plugin 'pschmitt/tmux-ssh-split'\n```\n\n## 🔌 Compatibility with Other Plugins\n\nSome plugins may attempt to bind the same keys as tmux-ssh-split. For instance,\n[tmux-pain-control](https://github.com/tmux-plugins/tmux-pain-control) is one\nsuch plugin. With the example configuration provided, both tmux-ssh-split\nand tmux-pain-control would try to bind the `|` key. The plugin loaded last\nwill prevail.\n\n### ✅ Solution\n\nI've sent\n[a PR to fix this](https://github.com/tmux-plugins/tmux-pain-control/pull/33)\nupstream. In the meantime you can\n[use my fork](https://github.com/pschmitt/tmux-pain-control/).\n\nTo make the **forked** `tmux-pain-control` not bind the `|` key you can set\nthe following:\n\n```\nset -g @disabled_keys \"|\"\n```\n\n## 🎩 Tips and Tricks\n\nIf you want to determine whether a command has been spawned via tmux-ssh-split\nin a local or remote split, you can check for the `TMUX_SSH_SPLIT` environment\nvariable. It should be set to `1` for all splits. If `TMUX_SSH_SPLIT` is not set\non remote splits, ensure that `TMUX_SSH_SPLIT` is listed in the `AcceptEnv`\nproperty in your sshd config. For example:\n\n```\nAcceptEnv LANG LC_* TMUX_SSH_SPLIT\n```\n\n🤚 If you want to disable this feature add the following to your TMUX config:\n\n```\nset-option -g @ssh-split-no-env \"true\"\n```\n\n## 📜 License\n\nThis project is open source and available under the terms of the\n[GNU General Public License v3.0](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschmitt%2Ftmux-ssh-split","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpschmitt%2Ftmux-ssh-split","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschmitt%2Ftmux-ssh-split/lists"}