Improve new_window helper function's internals

This commit is contained in:
2012-04-26 02:10:30 +01:00
parent 60e92c35e8
commit 0d3cfb2494

View File

@@ -16,13 +16,14 @@ new_window() {
if [ ! -z "$1" ]; then if [ ! -z "$1" ]; then
window="$1" window="$1"
fi fi
local command=()
if [ ! -z "$2" ]; then if [ ! -z "$2" ]; then
local command="\"$2\"" command+=("$2")
fi fi
if [ ! -z "$window" ]; then if [ ! -z "$window" ]; then
local winarg="-n \"$window\"" local winarg=(-n "$window")
fi fi
eval "tmux new-window -t \"$session:\" $winarg $command" tmux new-window -t "$session:" "${winarg[@]}" "${command[@]}"
} }
# Select a specific window. # Select a specific window.