Skip to content

Instantly share code, notes, and snippets.

@lordi
Last active February 27, 2019 10:39
Show Gist options
  • Save lordi/99195cff5940664ece5ceef1c82bde06 to your computer and use it in GitHub Desktop.
Save lordi/99195cff5940664ece5ceef1c82bde06 to your computer and use it in GitHub Desktop.
Sometimes another client restricts the screen size of the current session.
The following command will quickly kill all other tmux clients from the session.
tmux list-clients -t $(tmux display-message -p '#S') -F '#{client_tty}' | grep -v $(tmux display-message -p '#{client_tty}') | xargs --max-args 1 tmux detach-client -t
Add it to ~/.tmux.conf to have it as "C-b k" shortcut:
bind k neww "tmux list-clients -t $(tmux display-message -p '#S') -F '#{client_tty}' | grep -v $(tmux display-message -p '#{client_tty}') | xargs --max-args 1 tmux detach-client -t"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment