From 75ae3ba142ac4560fde1ad08c7aaf84039139454 Mon Sep 17 00:00:00 2001 From: Trae Robrock Date: Tue, 26 Jun 2012 16:35:23 -0700 Subject: [PATCH] Support tmux versions that do not have the -l flag --- lib/layout-helpers.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/layout-helpers.sh b/lib/layout-helpers.sh index 6bc661d..3886733 100644 --- a/lib/layout-helpers.sh +++ b/lib/layout-helpers.sh @@ -68,7 +68,12 @@ select_pane() { # - $2: (optional) Target pane ID to run command in. # run_cmd() { - tmux send-keys -t "$session:$window.$2" -l "$1" + literal_support=$(tmux send-keys -l 2&> /dev/null ; echo $?) + if [ $literal_support -eq 0 ]; then + tmux send-keys -t "$session:$window.$2" -l "$1" + else + tmux send-keys -t "$session:$window.$2" "$1" + fi tmux send-keys -t "$session:$window.$2" "C-m" }