Zenity and text formating

I just discovered that zenity support html tags.

zenity --error --text "hello <b>world</b>"

but how to make it work with entry type ?

zenity --entry --text "hello <b>world</b>"

It's printing tags instead of interpreting them.


Zenity and the entry option does not support the "pango" markup options.

error, info, question, warning are the only options that support these markups.

If you examine the man page for zenity - those options can have the pango markups turned on or off.

FYI this link gives you the markups supported: http://developer.gnome.org/pygtk/stable/pango-markup-language.html

The only suggestion I can make is to make this request upstream to the zenity developers


You can do this with yad, which you can install from the Software Centre. You can run:

yad --title "Customised title here" --entry --text " Are you <b>really</b> sure you want to add an entry?" --width=300 --center --button="gtk-cancel:252" --button="gtk-ok:0"

Terminal screenshot

To make this usable we need to get any data that was inputted and check which button was pressed. This does it:

data=$(yad --title "Customised title here" --entry --text " Are you <b>really</b> sure you want to add an entry?" --width=300 --center --button="gtk-cancel:252" --button="gtk-ok:0");rc=$?; [[ $rc = 252 ]] && data="";echo $data

For help on yad type yad --help-all or man yad but I found practical examples are easier to adapt. There are some here.