This commit is contained in:
Trae Robrock
2012-06-27 14:03:49 -07:00
3 changed files with 17 additions and 8 deletions

View File

@@ -61,6 +61,16 @@ select_pane() {
tmux select-pane -t "$session:$window.$1"
}
# Send/paste keys to the currently active pane/window.
#
# Arguments:
# - $1: String to paste.
# - $2: (optional) Target pane ID to send input to.
#
send_keys() {
tmux send-keys -t "$session:$window.$2" "$1"
}
# Runs a shell command in the currently active pane/window.
#
# Arguments:
@@ -68,13 +78,8 @@ select_pane() {
# - $2: (optional) Target pane ID to run command in.
#
run_cmd() {
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"
send_keys "$1" "$2"
send_keys "C-m" "$2"
}
# Cusomize session root path. Default is `$HOME`.

View File

@@ -2,4 +2,4 @@
set -e
[ -n "$TMUXIFIER_DEBUG" ] && set -x
echo "0.2.1"
echo "0.3.0"

View File

@@ -14,5 +14,9 @@ new_window "{{WINDOW_NAME}}"
#run_cmd "top" # runs in active pane
#run_cmd "date" 1 # runs in pane 1
# Paste text
#send_keys "top" # paste into active pane
#send_keys "date" 1 # paste into active pane
# Set active pane.
#select_pane 0