Skip to content

Commit 1c48c89

Browse files
Merge pull request openstack#132 from cloudbuilders/tmux
add support for tmux if USE_TMUX=yes
2 parents 296234b + 3ad59ea commit 1c48c89

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

stack.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,12 +958,17 @@ fi
958958
function screen_it {
959959
NL=`echo -ne '\015'`
960960
if [[ "$ENABLED_SERVICES" =~ "$1" ]]; then
961-
screen -S stack -X screen -t $1
962-
# sleep to allow bash to be ready to be send the command - we are
963-
# creating a new window in screen and then sends characters, so if
964-
# bash isn't running by the time we send the command, nothing happens
965-
sleep 1
966-
screen -S stack -p $1 -X stuff "$2$NL"
961+
if [[ "$USE_TMUX" =~ "yes" ]]; then
962+
tmux new-window -t stack -a -n "$1" "bash"
963+
tmux send-keys "$2" C-M
964+
else
965+
screen -S stack -X screen -t $1
966+
# sleep to allow bash to be ready to be send the command - we are
967+
# creating a new window in screen and then sends characters, so if
968+
# bash isn't running by the time we send the command, nothing happens
969+
sleep 1
970+
screen -S stack -p $1 -X stuff "$2$NL"
971+
fi
967972
fi
968973
}
969974

0 commit comments

Comments
 (0)