bash - whiptail - window resize -
i'm using whiptail menu based tool. i'm able set display current window on start :
window=$(stty -a | tr \; \\012 |egrep 'rows|columns' | cut '-d ' -f3) whiptail --title "multinode main menu" --menu "\n\n\n\n\n\n\n\n" --nocancel $window 20 ...
but content scrumbles when resize window. there way avoid when using whiptail ?
as per this wikipedia link,
eval `resize` whiptail ... $lines $columns $(( $lines - 8 )) ...
explanation: resize
command identifies current dimensions (lines , columns) of current window , sets 2 environment variables lines
, columns
. eval
block helps set these 2 env variables in shell underwhich whiptail
command running. way whiptail
receives $lines
, $columns
variables.
this set right dimensions whiptail ui.
Comments
Post a Comment