Fix window-auto when using in session layouts

This commit is contained in:
2024-04-12 22:10:56 +01:00
parent 14894bdf47
commit 2c859ddd93
7 changed files with 28 additions and 33 deletions

View File

@@ -1,13 +1,11 @@
#!/usr/bin/env zsh
cols=`tput cols`
lines=`tput lines`
cols=`tmux display -p "#{pane_width}"`
lines=`tmux display -p "#{pane_height}"`
width=$(( $cols / 2 )).0
height=$lines.0
ratio=$(( ($width / $height) * 100 ))
# echo "size: ( $width,$height ) ratio: $ratio"
if [[ $cols -lt 140 ]] && [[ $lines -lt 70 ]]; then
# terminal is too small
exit
@@ -15,7 +13,7 @@ fi
if [[ $ratio -ge 100 ]]; then
# terminal is wide or square
if [[ `tput cols` -gt 230 ]]; then
if [[ $cols -gt 230 ]]; then
# terminal is wide and large
`dirname $0`/window-wide-right
else