简体   繁体   中英

Bash - multiline Whiptail backtitle

I'm trying to add multiple lines to Whiptail dialogs backtitles.

I tried:

whiptail --clear --backtitle "asdf \n asdf \n asdf" \
         --title test --yesno test \
         0 0 "test" 3>&1 1>&2 2>&3
whiptail --clear --backtitle "asdf
asdf
asdf" \
         --title test --yesno test \
         0 0 "test" 3>&1 1>&2 2>&3
whiptail --clear --backtitle "$(printf '%s\n' asdf asdf asdf)" \
         --title test --yesno test \
         0 0 "test" 3>&1 1>&2 2>&3

Is there a way to have a multi line backtitle?

No.

Looking at the source that is hosted here you can see that the backtitle text is always drawn in the first column and first row.

But any position can be put there. This is the source of that function. I cloned the repo and verified that putting something other than position (0,0) where the backtitle option is parsed will have the text start wherever you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM