Skip to content

Commit

Permalink
fix: don't send command to tmux if --blank requested
Browse files Browse the repository at this point in the history
Prevents unnecessary shell executions processing a bunch of empty
commands. It also prevents the annoying extra line from being printed
from the blank initial command
  • Loading branch information
tjhop committed Mar 6, 2023
1 parent 20989f3 commit 5941019
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tmuxer
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ for pane in "${TMUXER_PANES[@]}"; do
tmux send-keys -t "${TMUXER_SESSION}:${TMUXER_WINDOW_NUMBER}" -R \; send-keys -t "${TMUXER_SESSION}:${TMUXER_WINDOW_NUMBER}" C-l \; clear-history

# assemble command to send to pane
tmux send-keys -t "${TMUXER_SESSION}:${TMUXER_WINDOW_NUMBER}" -- "${TMUXER_COMMAND//${_TMUXER_SUBST_STRING}/$pane}" C-m
if [[ ${TMUXER_BLANK} == 0 ]]; then
tmux send-keys -t "${TMUXER_SESSION}:${TMUXER_WINDOW_NUMBER}" -- "${TMUXER_COMMAND//${_TMUXER_SUBST_STRING}/$pane}" C-m
fi

# adjust layout after every pane created so tmux doesn't get upset about pane size
tmux select-layout -t "${TMUXER_SESSION}:${TMUXER_WINDOW_NUMBER}" "${TMUXER_LAYOUT}"
Expand Down

0 comments on commit 5941019

Please sign in to comment.