Red Hat Bugzilla – Bug 142538
dialog tailboxbg changes terminal settings
Last modified: 2007-11-30 17:07:05 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Description of problem:
After using dialog with a tailboxbg the terminal settings are not the
same as before. CR LF doesn't work, no typed characters are visible
and unicode support is disabled.
To see the problem, run a dialog sample script.
Enter directory /usr/share/doc/dialog-0.9b/samples
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. cd /usr/share/doc/samples/dialog-0.9b7samples
3. try to type commands
Actual Results: CR LF doesn't work, no typed characters are visible
and unicode support is disabled
Expected Results: The terminal settings should not beeing changed.
The machine was intalled with default settings, e.g.
language = en_US.UTF-8
terminal type = linux
After the samples script has finished I have to run the following
commands as a workaround:
I can add these commands at the end of the script too :-)
I don't see that (on Debian/testing, built dialog against
ncursesw). I pressed return to close the tailbox - seems
a little slow, but on exit the tty modes were working.
Perhaps you did a ^C and there's something wrong with
cleanup in that area (I checked for that, but a problem
there would be occasional if it happens - didn't see it).
Maybe, I have the problem on Red Hat Enterprise Linux 3 as well as on
Fedora Core 1. Tailbox works, but not tailboxbg! I didn't a ^C.
Checking dialog's source, I'm not sure where a
normal exit (catching signals, etc) would produce
a problem. It uses dlg_exit() for the actual
exit, and every place that would have initialized
the screen also calls end_dialog - which in turn
calls endwin. In endwin, ncurses is supposed to
reset the tty modes.
If I were able to reproduce this problem, I would
first see what part of the above is not true -
whether dialog is indeed calling the given
functions and if the tty modes are not reset due
to some problem in ncurses or dialog. Other than
by recompiling dialog to check this, the output
from ltrace should show the ncurses calls - it
it possible to get some insight from that trace:
we could see if endwin is called, and whether
the related ncurses tty mode functions are used.
This is the original sample script
on my FC 1 machine.
# $Id: tailboxbg,v 1.5 2003/08/15 19:40:37 tom Exp $
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15
./listing >listing.out &
$DIALOG --title "TAIL BOX" \
--tailboxbg listing.out 24 70 2>$tempfile
# wait a while for the background process to run
# now kill it
kill -3 `cat $tempfile` 2>&1 >/dev/null 2>/dev/null
# ...and the process that is making the listing
The dialog tailboxbg will be terminated by a SIGQUIT (kill -3).I have
tried other signals - same problem.
you could use "wait" and "kill %1"
I see (had forgotten a detail about the sample
script, and my quick check was too quick to get
caught by the timeout). Adding a wait won't help
much since the executable won't necessarily exit
without some help.
But the executable does have a SIGQUIT handler - I
may have (will test) overlooked providing a path
for the leftover process to initialize curses so
it can restore the tty modes.
The leftover process is the loop at the end of
Other than that the dialog program doesn't reset tty
modes until it's killed (which the script does), I can't
find anything going wrong - to reproduce this report.
I can modify dialog to reset tty modes when it forks to
create the waiting process, but that won't let you type
while the script is running (though it would improve the
behavior of typeahead). However the nature of the tailboxbg
is that it's expected to be the only process writing to the
screen (so there's limited usefulness there).
One detail that occurs to me: if you use 'reset', it wipes
out the UTF-8 setting (that's a limitation of the Linux console).
I'd use "stty sane" instead (if you're seeing the tty modes not
restored), which would leave UTF-8 alone.
I added a reset for the tty modes to the most recent update to
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
For more information of the RHEL errata support policy, please visit:
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.