Skip to content

Commit 3ad59ea

Browse files
committed
Use C-M for return carriage for tmux.
Conflicts: stack.sh
1 parent c204282 commit 3ad59ea

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
@@ -915,12 +915,17 @@ fi
915915
function screen_it {
916916
NL=`echo -ne '\015'`
917917
if [[ "$ENABLED_SERVICES" =~ "$1" ]]; then
918-
screen -S stack -X screen -t $1
919-
# sleep to allow bash to be ready to be send the command - we are
920-
# creating a new window in screen and then sends characters, so if
921-
# bash isn't running by the time we send the command, nothing happens
922-
sleep 1
923-
screen -S stack -p $1 -X stuff "$2$NL"
918+
if [[ "$USE_TMUX" =~ "yes" ]]; then
919+
tmux new-window -t stack -a -n "$1" "bash"
920+
tmux send-keys "$2" C-M
921+
else
922+
screen -S stack -X screen -t $1
923+
# sleep to allow bash to be ready to be send the command - we are
924+
# creating a new window in screen and then sends characters, so if
925+
# bash isn't running by the time we send the command, nothing happens
926+
sleep 1
927+
screen -S stack -p $1 -X stuff "$2$NL"
928+
fi
924929
fi
925930
}
926931

0 commit comments

Comments
 (0)