Question

I am trying to use dialog on bash but I get some extra text on the screen.

this is the line for dialog:

dialog --title "Hello" --msgbox 'Hello world!' 6 20

and this is the output:

enter image description here

any idea why this is happening?

Was it helpful?

Solution

It looks like dialog is using box-drawing characters which your terminal emulator doesn't understand properly (among other issues).

For a quick work-around, you can tell dialog to use - and + to draw boxes, or to not try to draw them at all:

dialog --ascii-lines --title "Hello" --msgbox 'Hello world!' 6 20
dialog --no-lines    --title "Hello" --msgbox 'Hello world!' 6 20

OTHER TIPS

(necro)

This somehow works for me.

#!/bin/bash

if [[ "$LANG" =~ 'UTF-8' ]]
then
  export NCURSES_NO_UTF8_ACS=0
else
  export NCURSES_NO_UTF8_ACS=1
fi

dialog --title "Confirmation"  --yesno "It works?" 5 30

For posterity, if the terminal is putty you can change the terminal type from xterm to linux (before you connect).

To do this on the PuTTY Configuration screen for your connection navigate to Connection->Data->Terminal-type String and change the value from xterm to linux. After that 'dialog' should display correctly.

Not meaning to necro-post, but I just had one of my techs bring a situation like this to me.

The trick that worked for us is;

  1. Left-click on the PuTTY symbol in the upper-left corner of the PuTTY terminal.
  2. Click "Change Settings"
  3. Highlight "Translation" in the left-pane of the "PuTTY Reconfiguration" window.
  4. Change "Remote Character Set" from "UTF-8" to "ISO-8859-1:1998 (Latin-1, West Europe)"
  5. Click "Apply".
  6. Re-run your dialog application.

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top