mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 01:46:40 +00:00
Improve new_window helper function's internals
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user