Last active
December 22, 2015 23:19
Revisions
-
numa08 revised this gist
Sep 13, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,8 @@ ssh() { fi local remote=${${(P)#}%.*} local old_name="$HOST" #現在のペインのタイトルを取得する方法がわかりません>_< しょうがないので、初期値のホスト名を指定 local renamed=0 if [[ $remote != -* ]]; then renamed=1 -
numa08 created this gist
Sep 13, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # https://www.spatof.org/blog/tmux-ssh-rename-window.html ssh() { if [[ $# == 0 || -z $TMUX ]]; then command ssh $@ fi local remote=${${(P)#}%.*} local old_name="$HOST" #現在のペインのタイトルを取得する方法がわかりません>_< local renamed=0 if [[ $remote != -* ]]; then renamed=1 #tmux rename-window $remote printf '\033]2;%s\033\\' "${remote}" fi command ssh $@ if [[ $renamed == 1 ]];then #tmux rename-window "$old_name" printf '\033]2;%s\033\\' "${old_name}" fi }