From 3ad59ea15148fc96329e3e6d69ad9d166b5a3b5e Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Wed, 2 Nov 2011 18:27:40 +0100 Subject: [PATCH] Use C-M for return carriage for tmux. Conflicts: stack.sh --- stack.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/stack.sh b/stack.sh index 1c51fbc..cac003c 100755 --- a/stack.sh +++ b/stack.sh @@ -915,12 +915,17 @@ fi function screen_it { NL=`echo -ne '\015'` if [[ "$ENABLED_SERVICES" =~ "$1" ]]; then - 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 - # bash isn't running by the time we send the command, nothing happens - sleep 1 - screen -S stack -p $1 -X stuff "$2$NL" + 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 + # bash isn't running by the time we send the command, nothing happens + sleep 1 + screen -S stack -p $1 -X stuff "$2$NL" + fi fi }