Merge pull request #132 from cloudbuilders/tmux
add support for tmux if USE_TMUX=yes
This commit is contained in:
commit
1c48c891c7
1 changed files with 11 additions and 6 deletions
5
stack.sh
5
stack.sh
|
@ -958,6 +958,10 @@ fi
|
|||
function screen_it {
|
||||
NL=`echo -ne '\015'`
|
||||
if [[ "$ENABLED_SERVICES" =~ "$1" ]]; then
|
||||
if [[ "$USE_TMUX" =~ "yes" ]]; then
|
||||
tmux new-window -t stack -a -n "$1" "bash"
|
||||
tmux send-keys "$2" C-M
|
||||
else
|
||||
screen -S stack -X screen -t $1
|
||||
# sleep to allow bash to be ready to be send the command - we are
|
||||
# creating a new window in screen and then sends characters, so if
|
||||
|
@ -965,6 +969,7 @@ function screen_it {
|
|||
sleep 1
|
||||
screen -S stack -p $1 -X stuff "$2$NL"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# create a new named screen to run processes in
|
||||
|
|
Loading…
Reference in a new issue