我正在使用whiptail作为一个基于菜单的工具。我可以在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
...但当我调整窗口大小时,内容会滚动。在使用whiptail时,有没有办法避免这种情况?
发布于 2017-07-28 16:45:36
根据this维基百科链接,
eval `resize`
whiptail ... $LINES $COLUMNS $(( $LINES - 8 )) ...说明:resize命令标识当前窗口的当前维度(行和列),并设置两个环境变量LINES和COLUMNS。eval块帮助在运行whiptail命令的shell中设置这两个环境变量。这样,whiptail就可以接收$LINES和$COLUMNS变量。
这将帮助你为你的whiptail UI设置正确的尺寸。
https://stackoverflow.com/questions/45365130
复制相似问题