1.\" $OpenBSD: wscons.4,v 1.24 2023/11/12 09:21:36 dlg Exp $ 2.\" $NetBSD: wscons.4,v 1.11 2000/04/13 11:14:42 is Exp $ 3.\" 4.\" Copyright (c) 1999 The NetBSD Foundation, Inc. 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 17.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26.\" POSSIBILITY OF SUCH DAMAGE. 27.\" 28.Dd $Mdocdate: November 12 2023 $ 29.Dt WSCONS 4 30.Os 31.Sh NAME 32.Nm wscons 33.Nd workstation console access 34.Sh SYNOPSIS 35.Cd option WSEMUL_SUN 36.Cd option WSEMUL_NO_VT100 37.Cd option WSEMUL_DEFAULT=\&"xxx\&" 38.Cd option WS_KERNEL_FG=WSCOL_XXX 39.Cd option WS_KERNEL_BG=WSCOL_XXX 40.Cd option WSDISPLAY_COMPAT_USL 41.Cd option WSDISPLAY_COMPAT_RAWKBD 42.Pp 43.Cd "wsdisplay* at ..." 44.Cd "wskbd* at ... mux N" 45.Cd "wsmouse* at ... mux N" 46.Pp 47.Cd "pseudo-device wsmux" Op Ar count 48.Sh DESCRIPTION 49The 50.Nm 51driver provides support for machine-independent access to the console. 52.Pp 53.Nm 54is made of a number of cooperating modules, in particular 55.Bl -bullet 56.It 57Hardware support for display adapters, keyboards and mice; see 58.Xr wsdisplay 4 , 59.Xr wskbd 4 , 60and 61.Xr wsmouse 4 . 62.It 63Input event multiplexor; see 64.Xr wsmux 4 . 65.It 66Terminal emulation modules (see below). 67.It 68Compatibility options to support control operations and other low-level 69behaviour of existing terminal drivers (see below). 70.El 71.Ss Terminal emulations 72.Nm 73does not define its own set of terminal control sequences and special keyboard 74codes in terms of 75.Xr termcap 5 . 76Instead, a 77.Dq terminal emulation 78is assigned to each virtual screen when the screen is created (see 79.Xr wsconscfg 8 ) . 80Different terminal emulations can be active at the same time on one display. 81.Pp 82The following choices are available: 83.Bl -tag -width vt100 84.It dumb 85This minimal terminal support is always available. 86No control sequences are supported besides the ASCII control characters. 87The cursor is not addressable. 88Only ASCII keyboard codes will be delivered, cursor and functions keys 89do not work. 90.It sun 91The 92.Dq sun 93console emulation is available by default on the sparc64 architecture, 94or if 95.Cd option WSEMUL_SUN 96was specified at kernel build time. 97It supports the control sequences of 98.Tn SUN 99machine consoles and delivers its keyboard codes for function and 100keypad keys (as far as present on the actually used keyboard). 101.Pp 102ANSI colors are also supported on this emulation, if the 103.Ev TERM 104environment variable is set to 105.Ar rcons-color . 106.Pp 107This emulation is sufficient for full-screen applications. 108.It vt100 109is available by default, but can be disabled with 110.Cd option WSEMUL_NO_VT100 . 111It provides the most commonly used functions of 112.Tn DEC VT100 113terminals with some extensions introduced by the 114.Tn DEC VT220 115and 116.Tn DEC VT320 117models. 118The features of the original 119.Tn VT100 120which are not, or not completely, implemented are: 121.Bl -bullet 122.It 123.Tn VT52 124support, 132-column-mode, smooth scroll, light background, keyboard 125autorepeat control, external printer support, keyboard locking, 126newline/linefeed switching: Escape sequences related 127to these features are ignored or answered with standard replies. 128(DECANM, DECCOLM, DECSCLM, DECSCNM, DECARM, DECPFF, DECPEX, KAM, LNM) 129.It 130Function keys are not reprogrammable and fonts cannot be downloaded. 131DECUDK and DECDLD sequences will be ignored. 132.It 133Neither C1 control set characters will be recognized nor will 8-bit keyboard 134codes be delivered. 135.It 136The 137.Dq DEC supplemental graphic 138font is approximated by the ISO-latin-1 font, though there are 139subtle differences. 140.It 141The actual rendering quality depends on the underlying graphics 142hardware driver. 143Characters might be missing in the available fonts and be 144substituted by more or less fitting replacements. 145.Pp 146Depending on the keyboard used, not all function keys might be available. 147.El 148.Pp 149In addition to the plain 150.Tn VT100 151functions, the following features are supported: 152.Bl -bullet 153.It 154ANSI colors 155.It 156Some 157.Tn VT220 158-like presentation state settings and -reports (DECRSPS), especially 159tabulator settings. 160.El 161.Pp 162In most applications, 163.Nm 164will work sufficiently as a 165.Tn VT220 166emulator. 167.El 168.Pp 169The 170.Va WSEMUL_DEFAULT 171kernel option allows selecting one of the described terminal options 172as the default choice. 173The default goes into effect at kernel startup, i.e., 174for the operating system console or additional screens allocated 175through the 176.Va WSDISPLAY_DEFAULTSCREENS 177option (see 178.Xr wsdisplay 4 ) , 179or if no emulation type was passed to the 180.Xr wsconscfg 8 181utility. 182.Pp 183.Em Compatibility options : 184these options allow running X servers or other programs using low-level 185console driver functions which were written specifically for other 186console drivers to run on 187.Ox 188systems. 189The options are in particular: 190.Bl -tag -width WSDISPLAY_COMPAT_xxxxxxxx 191.It Cd WSDISPLAY_COMPAT_USL 192Support the protocol for switches between multiple virtual screens on 193one display as used by most PC-UNIX variants. 194.It Cd WSDISPLAY_COMPAT_RAWKBD 195Allows getting raw XT keyboard scancodes from PC keyboards as needed 196by X servers. 197.El 198.Pp 199.Em Other options : 200.Bl -tag -width 3n 201.It Cd option WS_KERNEL_FG=WSCOL_XXX 202.It Cd option WS_KERNEL_BG=WSCOL_XXX 203.It Cd option \&WS_KERNEL_COLATTR="(WSATTR_XXX | WSATTR_YYY)" 204.It Cd option \&WS_KERNEL_MONOATTR="(WSATTR_XXX | WSATTR_YYY)" 205Make console output originating from the kernel appear differently 206than output from user level programs (via 207.Pa /dev/console 208or the specific tty 209device like 210.Pa /dev/ttyC0 ) . 211.Dq WS_KERNEL_FG 212and 213.Dq WS_KERNEL_BG 214set the foreground/background used on color displays. 215.Pp 216The 217.Dq WSCOL_XXX 218arguments are colors as defined in 219.Pa /usr/include/dev/wscons/wsdisplayvar.h . 220.Dq WS_KERNEL_COLATTR 221and 222.Dq WS_KERNEL_MONOATTR 223are additional attribute flags used on color or monochrome displays, 224respectively. 225The arguments are defined in the same header file. 226Whether the attributes 227are supported or not depends on the actually used graphics adapter. 228These options are ignored by the 229.Dq dumb 230terminal emulation. 231.It Cd option WSCOMPAT_USL_SYNCTIMEOUT=nnn 232The virtual screen switching protocol enabled by 233.Dq WSDISPLAY_COMPAT_USL 234uses a somewhat complex handshake protocol to pass control to user programs 235as X servers controlling a virtual screen. 236To avoid a non-responsive application locking the whole console system, a 237screen switch will be rolled back if the user application does not respond 238to a screen switch request within some time. 239This option sets the timeout (in seconds); 240the default value is 5 seconds. 241.El 242.Sh SEE ALSO 243.Xr intro 4 , 244.Xr wsdisplay 4 , 245.Xr wskbd 4 , 246.Xr wsmouse 4 , 247.Xr wsmux 4 , 248.Xr wsconscfg 8 , 249.Xr wsconsctl 8 , 250.Xr wsfontload 8 , 251.Xr wsmoused 8 252