tmux-xpanes icon indicating copy to clipboard operation
tmux-xpanes copied to clipboard

target specific window with new panes

Open kurktchiev opened this issue 3 years ago • 0 comments

So I work with groups of servers and clusters and such and normally I have a dedicated window to handle those specific groups of splits.

Also, I tend to connect to multiple VPNs at the same time and have a dedicated VPN window that I send all of my vpn connections to, so I can easily check and track whats/where.

Here is an example of my VPN function that shows what I mean:

# Create a VPN creator for TMUX
# note that you want to work it as: tvpn "some vpn string #tag"
# where #tag will be used to name the newly created pane/split
function tvpn() {
  name=$(awk '{print $NF}' <<< "$@")
  if tmux list-windows | grep -qw "vpns"; then
    tmux split-pane -t vpns -v -p 80 $@
    tmux setw -t vpns pane-border-status bottom
    tmux setw -t vpns pane-border-format "$name"
  else
    tmux new-window -n vpns $@
    tmux setw -t vpns pane-border-status bottom
    tmux setw -t vpns pane-border-format "$name"
  fi
}

If you replace the VPN example above with servers, say routers or maybe k8s boxes, or whatever, you can see that grouping them up would be much simpler and faster than having random windows with some of them all over the place.

kurktchiev avatar Dec 18 '20 13:12 kurktchiev