summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-11-07 10:30:20 +0000
committerdteske <dteske@FreeBSD.org>2013-11-07 10:30:20 +0000
commit12ce64e99c9bb859eea3528c16c04bc293697402 (patch)
tree5fd68e0e145077a371809102a8ef1cce31b0b670
parentddc2ccec80a7ecc6c1bb4607310d3b3df28f1eaa (diff)
downloadFreeBSD-src-12ce64e99c9bb859eea3528c16c04bc293697402.zip
FreeBSD-src-12ce64e99c9bb859eea3528c16c04bc293697402.tar.gz
Use dialog(1) to obtain maximum-size; stty fails when running in a pipe-
chain. This allows dialogs to reach full size even when executed as an rvalue operand to a pipe (e.g., cat file | bsdconfig -f-).
-rw-r--r--usr.sbin/bsdconfig/share/dialog.subr11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index 01e928d..1a0c276 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
OpenPOWER on IntegriCloud