it makes no sense to call hostname -s several times

This commit is contained in:
Uwe Werler 2016-08-28 21:04:23 +02:00
parent f5f02a6e35
commit 5678ce9e10

4
SSH.sh
View File

@ -112,12 +112,14 @@ _setwin(){
done
$_tmux list-windows -F "#{window_id} #{pane_id} #{@HOST}" -t ${_sess} | {
_localhost=$(hostname -s)
while read _winid _paneid _val; do
_host=${VALS[${_paneid##%}]}
[[ -z ${_host} ]] && _host=$(hostname -s)
[[ -z ${_host} ]] && _host=${_localhost}
[[ ${_val} == ${_host} ]] || \
$_tmux setw -q -t ${_winid} "@HOST" "$(printf %-${_tabw}.${_tabw}s ${_host})"