]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Add timeout to wait for window resized
authorSergey Matveev <stargrave@stargrave.org>
Thu, 19 Nov 2020 09:56:54 +0000 (12:56 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 19 Nov 2020 09:56:54 +0000 (12:56 +0300)
bin/bin/www

index e7beed973f3a2fe416f2b9f0c66d14b40410f946..99cbe936d7c17019e47ddfb534f530470c69f530 100755 (executable)
@@ -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