NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/50222: Backspace key does not erase, generates '^?' charactor in framebuffer conosole and ttyEx



>Number:         50222
>Category:       misc
>Synopsis:       Backspace key does not erase, generates '^?' charactor in framebuffer conosole and ttyEx
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 09 15:00:00 +0000 2015
>Originator:     Yasushi Oshima
>Release:        NetBSD 7.0_RC3
>Organization:
>Environment:
NetBSD hassaku 7.0_RC3 NetBSD 7.0_RC3 (GENERIC.201508110747Z) amd64
>Description:
When login shell is /bin/csh or /bin/sh (without set -o emacs or -o vi) and execute tset(1),
Backspace key generates '^?' charactor, instead of erase one charactor.

% stty -a
(snip)
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^H; intr = ^C; kill = ^U; lnext = ^V;
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
        stop = ^S; susp = ^Z; time = 0; werase = ^W;

Because of this, 'kbs' in terminfo is '^H'.

% infocmp wsvt25 | grep kbs
        il1=\E[L, ind=\ED, is2=\E[r\E[25;1H, kbs=^H, kcub1=\E[D,
% infocmp vt100 | grep kbs
        ka1=\EOq, ka3=\EOs, kb2=\EOr, kbs=^H, kc1=\EOp, kc3=\EOn,

In /etc/ttys, the terminal type of console is vt100, and this of ttyyE? is wsvt25.

tset(1) sets the value of 'kbs' in terminfo to termios's c_cc[VERASE].

BTW, when remove tset line in .login for csh and re-login,

@@ -14,7 +14,7 @@
 endif

 set noglob
-eval `tset -s -m 'network:?xterm'`
+# eval `tset -s -m 'network:?xterm'`
 unset noglob
 stty status '^T' crt -tostop

The erase shows '^?'. but when run tset(1), it becames '^H'.

% stty -a 
(snip)
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
        stop = ^S; susp = ^Z; time = 0; werase = ^W;

% tset
% stty -a
(snip)
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^H; intr = ^C; kill = ^U; lnext = ^V;
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
        stop = ^S; susp = ^Z; time = 0; werase = ^W;

This problem will occur  not only in wsvt25 and vt100.
It will be occur in another terminal type which use system console(for example, TERM=x68k, the special console type for NetBSD/x68k).

>How-To-Repeat:
1. login to system from console or ttyE1,ttyE2,...
2. show stty(1) erase
3. exec tset(1)
4. show stty(1) erase again
5. push Backspace key in csh or input-mode of vi(1).

>Fix:
The default value of stty erase (which is termios.c_cc[VERASE]) is CERASE in /usr/include/sys/ttydefaults.h, this is 0177(='^?').

I think the value of 'kbs' in the terminal type entry in the terminfo database shall  be the same as this.

At least,  kbs=\177 in wsvt25 entry is required.

vt100 which is used for console, I don't know change or not the value of kbs. vt100 is very common type. Should change it to another type for pc console?





Home | Main Index | Thread Index | Old Index