mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
new_window: only set $window and pass -n if a name is provided
Otherwise `new_window` after `new_window foo` would re-use the same name, resulting in an error.
This commit is contained in:
@@ -18,9 +18,11 @@ tmux() {
|
|||||||
# - $2: (optional) Shell command to execute when window is created.
|
# - $2: (optional) Shell command to execute when window is created.
|
||||||
#
|
#
|
||||||
new_window() {
|
new_window() {
|
||||||
if [ -n "$1" ]; then window="$1"; fi
|
if [ -n "$1" ]; then
|
||||||
|
window="$1"
|
||||||
|
local winarg=(-n "$window")
|
||||||
|
fi
|
||||||
if [ -n "$2" ]; then local command=("$2"); fi
|
if [ -n "$2" ]; then local command=("$2"); fi
|
||||||
if [ -n "$window" ]; then local winarg=(-n "$window"); fi
|
|
||||||
|
|
||||||
tmuxifier-tmux new-window -t "$session:" "${winarg[@]}" "${command[@]}"
|
tmuxifier-tmux new-window -t "$session:" "${winarg[@]}" "${command[@]}"
|
||||||
__go_to_window_or_session_path
|
__go_to_window_or_session_path
|
||||||
|
|||||||
Reference in New Issue
Block a user