tmux_ssh: a nice way to initiate an ssh sessin in tmux
This commit is contained in:
parent
d0ff7713dc
commit
c64ce4e553
1 changed files with 9 additions and 0 deletions
9
tmux_ssh
Executable file
9
tmux_ssh
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
session_name=ssh
|
||||||
|
ssh_cmd="termcompat ssh $1"
|
||||||
|
window_name=${1%%.*}
|
||||||
|
|
||||||
|
current_sessions=($(tmux list-sessions -F'#S'))
|
||||||
|
(( $session_exists[(I)$session_name] )) || tmux new-session -ds $session_name
|
||||||
|
|
||||||
|
exec tmux new-window -t ssh: -n $window_name $ssh_cmd
|
Loading…
Reference in a new issue