From 2dd3f5e62b8b89488ef607bdabb6701c6827dd19 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 19 Nov 2020 12:56:54 +0300 Subject: [PATCH] Add timeout to wait for window resized --- bin/bin/www | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 -- 2.44.0