mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Merge branch 'master' of https://github.com/jimeh/tmuxifier
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
set -e
|
||||
[ -n "$TMUXIFIER_DEBUG" ] && set -x
|
||||
|
||||
echo "0.2.1"
|
||||
echo "0.3.0"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user