diff options
Diffstat (limited to 'usr.sbin/bsdconfig/share/dialog.subr')
-rw-r--r-- | usr.sbin/bsdconfig/share/dialog.subr | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr index 01e928d..1297711 100644 --- a/usr.sbin/bsdconfig/share/dialog.subr +++ b/usr.sbin/bsdconfig/share/dialog.subr @@ -301,7 +301,16 @@ f_dialog_max_size() if [ "$USE_XDIALOG" ]; then __max_size="$XDIALOG_MAXSIZE" # see CONFIGURATION else - __max_size=$( stty size 2> /dev/null ) # usually "24 80" + if __max_size=$( $DIALOG --print-maxsize \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) + then + # usually "MaxSize: 24, 80" + __max_size="${__max_size#*: }" + f_replaceall "$__max_size" "," "" __max_size + else + __max_size=$( stty size 2> /dev/null ) + # usually "24 80" + fi : ${__max_size:=$DEFAULT_TERMINAL_SIZE} fi if [ "$__var_height" ]; then @@ -518,7 +527,7 @@ f_dialog_menu_constrain() : ${__min_rows:=0} fi - local __max_rows=$(( $__max_height_menu_constrain - 8 )) + local __max_rows=$(( $__max_height_menu_constrain - 7 )) # If prompt_len is zero (no prompt), bump the max-rows by 1 # Default assumption is (if no argument) that there's no prompt [ ${__prompt_len:-0} -gt 0 ] || |