[comp.bugs.sys5] initscr mungs tty mode in pcomm

hood@osiris.cso.uiuc.edu (11/04/88)

Reference the problem with curses' initscr() clobbering tabs... this is
in every version of curses I've seen.  The only real solution is to
make sure that your .profile (or /etc/profile) has the "tput" command
to set the tab stops.

Excerpts from the Pcomm Readme.7300 file:

	For example, curses(3) looks at the terminfo database to see if
	your terminal has "hardware tabs", if so, it expects the tab
	stops to be set.  Ignoring tabs by using "stty -tabs" (to
	convert tabs to spaces) won't work, in fact, curses(3) RESETS
	things as if you had typed "stty tabs"!

	I understand that newer versions of Unix have a "init" option to
	the "tput" command to perform all the initialization with only
	one argument.  For example:

		tputs init
		tabs

	Otherwise, a somewhat longer solution is:

		eval `tput iprog`
		tput is1
		tput is2
		if [ -n "`tput hts`" ] ;then
			stty tabs
		else
			stty -tabs
		fi
		tabs
		cat -s "`tput if`"
		tput is3
		echo "\r\c"


Emmet P. Gray				US Army, HQ III Corps & Fort Hood
...!uunet!uiucuxc!fthood!egray		Attn: AFZF-DE-ENV
					Directorate of Engineering & Housing
					Environmental Management Office
					Fort Hood, TX 76544-5057

hansen@pegasus.ATT.COM (Tony L. Hansen) (11/11/88)

< I understand that newer versions of Unix have a "init" option to the
< "tput" command to perform all the initialization with only one argument.
< For example:
<
<	tputs init
<	tabs

Actually, it is

	tput init

and the program tabs need not be called, because 'tput init' will set the
tab stops as part of its initialization process (except if it#8). For those
familiar with tset, 'tput init' does all of the terminal initialization
setups that tset did.

This option to tput was added in System V release 3.0.

					Tony Hansen
				att!pegasus!hansen, attmail!tony