https://github.com/alberti42/tmux-ssh-syncing

A zsh plugin to sync tmux window names with ssh sessions

https://github.com/alberti42/tmux-ssh-syncing

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

A zsh plugin to sync tmux window names with ssh sessions

Basic Info
  • Host: GitHub
  • Owner: alberti42
  • License: mit
  • Language: Shell
  • Default Branch: main
  • Homepage:
  • Size: 3.57 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 5
Created over 1 year ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

tmux-ssh-syncing Plugin for Zsh Shell

Synchronize your tmux window names with active ssh sessions. This plugin dynamically updates the tmux window name to reflect the remote hosts of active ssh sessions in the same window. It also restores the original window name when all ssh sessions are closed.

Features

  • Dynamically updates tmux window names to show connected remote hosts.
  • Ensures unique and clean concatenation of remote hostnames.
  • Automatically restores the original tmux window name when no ssh sessions remain.
  • Automatically restores the original cursor style after an ssh session
  • Works seamlessly with oh-my-zsh and zinit plugin managers.

https://github.com/user-attachments/assets/25f5c846-5093-4307-a77d-17f2598cdf44


Installation

Using oh-my-zsh

  1. Clone the repository into the custom/plugins directory: git clone https://github.com/alberti42/tmux-ssh-syncing.git $ZSH_CUSTOM/plugins/tmux-ssh-syncing

  2. Add the plugin to your .zshrc: plugins=(... tmux-ssh-syncing)

  3. Restart your terminal or reload your shell: source ~/.zshrc

Using zinit

  1. Add the following to your .zshrc: zinit ice lucid wait zinit light alberti42/tmux-ssh-syncing

  2. Restart your terminal or reload your shell: source ~/.zshrc


How It Works

  • When you start an ssh session inside tmux, the plugin:
    • Captures the remote hostname of the session.
    • Appends the hostname to the current tmux window name.
    • Ensures unique hostnames in the window name.
  • When the ssh session ends:
    • The plugin removes the hostname from the tmux window name.
    • If no active ssh sessions remain, it restores the original window name.

Example

  1. Open a tmux session.
  2. Start an ssh session: ssh user@remote-host The tmux window name updates to: remote-host

  3. Open another pane and start a new ssh session: ssh user@another-host The tmux window name updates to: remote-host+another-host

  4. Exit one or both ssh sessions, and the window name dynamically adjusts or restores to its original name.


License

This project is licensed under the MIT License. See the LICENSE file for details.

Owner

  • Name: Andrea Alberti
  • Login: alberti42
  • Kind: user
  • Location: Munich

Quantum physicists

GitHub Events

Total
  • Release event: 4
  • Watch event: 2
  • Public event: 1
  • Push event: 36
  • Fork event: 1
  • Create event: 4
Last Year
  • Release event: 4
  • Watch event: 2
  • Public event: 1
  • Push event: 36
  • Fork event: 1
  • Create event: 4