mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Update new_window helper's handling of window name and init command
New behavior of `new_window` helper: - When no argument is specified no specific window name is set. - Second argument added to pass a shell command to be executed. If a shell command is needed, but no window name is desired, pass an empty string `""` as the first argument.
This commit is contained in:
@@ -11,7 +11,13 @@ new_window() {
|
||||
if [ ! -z "$1" ]; then
|
||||
window="$1"
|
||||
fi
|
||||
tmux new-window -t "$session:" -n "$window"
|
||||
if [ ! -z "$2" ]; then
|
||||
local command="\"$2\""
|
||||
fi
|
||||
if [ ! -z "$window" ]; then
|
||||
local winarg="-n \"$window\""
|
||||
fi
|
||||
eval "tmux new-window -t \"$session:\" $winarg $command"
|
||||
}
|
||||
|
||||
# Load specified window layout.
|
||||
|
||||
Reference in New Issue
Block a user