zsh:g{log,stash}: Drop tput for stty for size

As stty is part of POSIX and thus better available.
This commit is contained in:
2021-06-01 22:10:39 +02:00
parent 6856c2d27e
commit 3db2c2a87e
2 changed files with 6 additions and 2 deletions

View File

@@ -108,7 +108,9 @@ local -a fzf_args=(
# 0.45 seems to be round about the ratio between cols and lines on my system.
# With that I get somewhat decent results with. This probably depends on the
# font and font-size of the terminal and needs to be changed potentially.
if (( $(tput cols) * 0.4 > $(tput lines) )); then
local -a tty_size
tty_size=(${=$(command stty size 2>/dev/null)})
if (( ! $? )) && (( $tty_size[2] * 0.4 > $tty_size[1] )); then
fzf_args+=(--preview-window=right)
else
fzf_args+=(--preview-window=down)

View File

@@ -108,7 +108,9 @@ local -a fzf_args=(
# 0.45 seems to be round about the ratio between cols and lines on my system.
# With that I get somewhat decent results with. This probably depends on the
# font and font-size of the terminal and needs to be changed potentially.
if (( $(tput cols) * 0.4 > $(tput lines) )); then
local -a tty_size
tty_size=(${=$(command stty size 2>/dev/null)})
if (( ! $? )) && (( $tty_size[2] * 0.4 > $tty_size[1] )); then
fzf_args+=(--preview-window=right)
else
fzf_args+=(--preview-window=down)