Browse Source

tmux_ssh: a nice way to initiate an ssh sessin in tmux

master
Von Random 1 month ago
parent
commit
c64ce4e553
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      tmux_ssh

+ 9
- 0
tmux_ssh View File

@@ -0,0 +1,9 @@
1
+#!/usr/bin/env zsh
2
+session_name=ssh
3
+ssh_cmd="termcompat ssh $1"
4
+window_name=${1%%.*}
5
+
6
+current_sessions=($(tmux list-sessions -F'#S'))
7
+(( $session_exists[(I)$session_name] )) || tmux new-session -ds $session_name
8
+
9
+exec tmux new-window -t ssh: -n $window_name $ssh_cmd

Loading…
Cancel
Save