From: Sergey Matveev Date: Thu, 19 Nov 2020 09:56:54 +0000 (+0300) Subject: Add timeout to wait for window resized X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=2dd3f5e62b8b89488ef607bdabb6701c6827dd19 Add timeout to wait for window resized --- diff --git a/bin/bin/www b/bin/bin/www index e7beed9..99cbe93 100755 --- a/bin/bin/www +++ b/bin/bin/www @@ -5,11 +5,14 @@ term() { } if tmux has-session -t www 2> /dev/null ; then - tmux new-window -t www "lynx $@" attached=`tmux list-sessions -F "#{session_attached}" -f "#{==:#{session_name},www}"` - [ "$attached" != "0" ] || term & + [ "$attached" != "0" ] || { + term & + sleep 0.5 + } + tmux new-window -t www "lynx $@" else - tmux new-session -d -s www "lynx $@" + tmux new-session -d -s www "sleep 0.5 ; lynx $@" tmux set-option -t www default-command lynx term & fi