Subject: misc/28402: reset command does not work (termcap problem)
To: None <,,>
From: Pavel Cahyna <>
List: netbsd-bugs
Date: 11/23/2004 20:51:03
>Number:         28402
>Category:       misc
>Synopsis:       reset command does not work (termcap problem)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 23 20:51:03 +0000 2004
>Originator:     Pavel Cahyna
>Release:        NetBSD 2.0_BETA i386

System: NetBSD 2.0_BETA (GENERIC_DIAGNOSTIC s patchem D. Reeda - PR#26839) #4: Wed Oct  6 10:13:10 CEST 2004


if a console program crashes, the reset command is supposed to get the terminal to a 
clean state, but it fails to do so in both xterm and wscons. What it does is to output 
the "rs" sequence, but many terminal types (including wsvt25, vt220 and xterm) don't 
have such sequence defined. Some (as the vt220) have only "r2" sequence, which is 
terminfo only, and more, this doesn't work either even if renamed to "rs". 

Terminfo on linux has rs1, rs2 and rs3. rs1 seems to do the job on xterm (where it is defined
as Esc c), but not on vt220 (where it is Esc   [   ?   3   l).


to simulate the effect of a crashed application, type tput vi. The cursor disappears.
Now type reset in an attempt to restore it. Nothing happens. ssh to a linux host and type 
reset there. The cursor is restored properly (in xterm, not in wscons, here even reset on 
linux fails).


find the hard reset strings in ttys documentation and add them as the rs capability
to /usr/share/misc/termcap.
For both xterm and wscons, adding rs=\Ec works (this is rs1 in the linux terminfo entry for 
xterm). According to the xterm documentation
(, this escape sequence should be standard
on DEC ttys, but I do not have any VT100 to test it.