Subject: misc/11052: xterm "tput reset" fails to rset SGR
To: None <>
From: John Hawkinson <>
List: netbsd-bugs
Date: 09/20/2000 19:34:23
>Number:         11052
>Category:       misc
>Synopsis:       xterm "tput reset" fails to rset SGR
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 20 19:40:00 PDT 2000
>Originator:     John Hawkinson
>Release:        netbsd-1-5 of 15 Aug 2000
System: NetBSD 1.5E NetBSD 1.5E (ZORKMID-$Revision: 1.2 $) #54: Fri Aug 18 01:53:49 EDT 2000 i386


	"tput init" fails to reset SGR characteristics (e.g. blink)
in an xterm. The problem is that the reset string outputs DECSC
and DECRC around the rest of the reset string, and instead of merely
saving the cursor position, SC/RC also save the SGR characteristics.

	"tput reset" fails to do anything at all, which is counterintuitive.
Enter standout mode (explicitly, or by getting left that way from
a confused application. My usual case is running mutt over an ssh connection
and having the network fall out from under me, usually because I've
lost wireless network, by getting on the train or something ;-)):

zorkmid% cat

Examine the reset sequence:

zorkmid% tput init | cat -v

That's: DECSC (Save cursor), DECSTBM (scrolling region), SGR (char
attributes), DECSET (various), DECRST (various), RM (replace mode), DECRC
(restore cursor).

Try it and watch it fail:

zorkmid% tput init

	Not sure how this stuff is supposed to work. Is it an xterm bug?
	or a termcap lib bug? Or a termcap entry bug?

	It seems mightly peculiar, also, that "tput -Tvt100 init" and
	"tput -Tvt100 reset" do nothing at all.

	Perhaps someone should note this in tput(1)'s BUGS section :-(