Skip to content

Commit

Permalink
Fixed a bug that tmux does not open all if too many pods
Browse files Browse the repository at this point in the history
  • Loading branch information
predatorray committed May 20, 2020
1 parent 413e04b commit eb60dd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME=kubectl-tmux-exec
VERSION=0.0.4
VERSION=0.1.0

OUTPUT_DIR=output
RELEASE_FILE_NAME=$(NAME)-$(VERSION).tar.gz
Expand Down
7 changes: 3 additions & 4 deletions bin/kubectl-tmux_exec
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ function main() {
;;
-*)
if [[ "${#opt}" -eq 2 ]]; then
if array_contains "${opt:1}" "${KUBECTL_NOARG_SHORT_OPTS[@]}"; then
kubectl_opts+=("${opt}")
elif array_contains "${opt:1}" "${KUBECTL_SHORT_OPTS[@]}"; then
if array_contains "${opt:1}" "${KUBECTL_SHORT_OPTS[@]}"; then
shift
kubectl_opts+=("${opt}" "$1")
else
Expand Down Expand Up @@ -281,12 +279,13 @@ function main() {
else
tmux_commands+=('split-window' "${cmd}" ';')
fi
tmux_commands+=('select-layout' "${tmux_layout}" ';')
done

if [[ "${remain_on_exit}" -eq 1 ]]; then
tmux_commands+=('set-option' 'remain-on-exit' 'on' ';')
fi
tmux_commands+=('select-layout' "${tmux_layout}" ';' 'setw' 'synchronize-panes' 'on' ';')
tmux_commands+=('setw' 'synchronize-panes' 'on' ';')

exec tmux "${tmux_commands[@]}"
}
Expand Down

0 comments on commit eb60dd7

Please sign in to comment.