aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-08-16 16:47:50 -0400
committerEugene Triguba <hello@eugenetriguba.com>2025-08-16 16:47:50 -0400
commit46ed06877167c43fca692b35f3a069d346041768 (patch)
treee3869e9ec603a09011900db22af69f1f56dd9e89
parentFix bug with assuming first pane is at index 1 (diff)
downloadtmux-toggle-term-46ed06877167c43fca692b35f3a069d346041768.zip
Adjust comment
-rwxr-xr-xtoggle-term.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/toggle-term.sh b/toggle-term.sh
index d19fd70..ba6dc89 100755
--- a/toggle-term.sh
+++ b/toggle-term.sh
@@ -91,8 +91,10 @@ toggle_split() {
# If we have more than 1 pane and none are zoomed in, we can assume the
# screen has the split pane open.
#
- # To simulate 'toggling' between the main pane and the split
- # pane, we 'zoom' the main pane so it takes up the full screen.
+ # So, to simulate 'toggling' between the main (first) pane and the split
+ # pane, we 'zoom' the main pane so it takes up the full screen. Because
+ # the initial pane index is configurable in tmux, we grab the first pane
+ # index dynamically.
first_pane_index="$($TMUX_CMD list-panes -F '#{pane_index}' | head -n1)"
$TMUX_CMD resize-pane -Z -t"$first_pane_index"
}