xref: /freebsd/share/man/man4/screen.4 (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1.\"
2.Dd October 6, 2000
3.Dt SCREEN 4
4.Os
5.Sh NAME
6.Nm screen
7.Nd pc display interface
8.Sh DESCRIPTION
9Access to the
10.Em virtual consoles
11are obtained through the device files
12.Pa /dev/ttyv0
13-
14.Pa /dev/ttyvb .
15Each of these files correspond to a separate
16virtual console.
17All virtual console devices can be open at once, but only one is
18active at a time.
19The active virtual console "owns" the keyboard and
20display screen.
21.Pp
22Output to a virtual console that not currently is on the display is
23saved in a buffer that holds a "screenfull" (normally 25) lines.
24Any output written to
25.Pa /dev/console
26(the original console device) is echoed to
27.Pa /dev/ttyv0 .
28.Pp
29To switch between the virtual consoles one uses the sequence
30.Em ALT+Fn ,
31which means hold down ALT and press one of the function keys.
32The
33virtual console with the same number as the function key is then
34selected as the current virtual console, and given exclusive use of
35the keyboard and display.
36This switch sequence can be changed via
37the keyboard mapping ioctl call (see
38.Xr keyboard 4 ) .
39.Pp
40The console allows entering values that are not physically
41present on the keyboard via a special keysequence.
42To use this facility press and hold down ALT,
43then enter a decimal number from 0-255 via the numerical keypad, then
44release ALT.
45The entered value is then used as the ASCII value for one
46character.
47This way it is possible to enter any ASCII value.
48The console driver also includes a history function.
49It is activated by
50pressing the scroll-lock key.
51This holds the display, and enables the cursor
52arrows for scrolling up and down through the last scrolled out lines.
53.Pp
54The console understands a subset of the ANSI x3.64 character
55sequences.
56For compatibility with the old pccons, the PC3 character
57sequences are also supported.
58.Bd -literal
59ANSI	Seq	Function				Termcap entry
60======= ======= =====================================   ==============
61
62--	E7	Save cursor position			sc
63
64--	E8	Restore	saved cursor position		rc
65
66--	Ec	Reset					rs
67
68--	EM	move cursor up 1 line,			--
69		scroll if at top
70
71CUU     E[nA    move cursor up n lines                  up/UP (ku)
72
73CUD     E[nB    move cursor down n lines                do/DO (kd)
74
75CUF     E[nC    move cursor right n characters          nd/RI (kr)
76
77CUB     E[nD    move cursor left n characters           --/LE (kl)
78
79HPA     E[n`    move cursor to character position n     ch
80
81HPR	E[na	move cursor right n characters 		--
82
83VPA     E[nd    move cursor to line n                   cv
84
85VPR	E[ne	move cursor down n lines		--
86
87CPL     E[nF    move cursor to start of line,           -- (@7)
88		n lines up
89
90CNL     E[nE    move cursor to start of line,           nw
91		n lines down
92
93CUP	E[y;xH	Move cursor to x, y			cm
94
95HVP	E[y;xf	Move cursor to x, y			--
96
97CBT     E[nZ    Move cursor back n tab stops            bt (kB)
98
99IL      E[nL    Insert n blank lines                    al/AL
100
101ICH     E[n@    Insert n blank characters               ic/IC
102
103DL      E[nM    Delete n lines                          dl/DL
104
105DCH     E[nP    Delete n characters                     dc/DC
106
107ED	E[nJ	Erase part or all of display:		cd
108		n=0 from cursor to end of display,
109		n=1 from begin of display to cursor,
110		n=2 entire display.
111
112EL	E[nK	Erase part or all of line:		ce
113		n=0 from cursor to end of line,
114		n=1 from begin of line to cursor,
115		n=2 entire line.
116
117ECH     E[nX    Erase n characters                      ec
118
119SU      E[nS    Scroll display n lines up (forward)     sf/SF
120
121SD      E[nT    Scroll display n lines down (reverse)   sr/SR
122
123
124SGR	E[nm	Set character attributes:		--
125		n= 0  normal attribute (all off)
126		n= 1  bold (highlight)
127		n= 4  underscore (if supported by HW)
128		n= 5  blink (if supported by HW)
129		n= 7  reverse
130		n= 22 remove bold
131		n= 24 remove underscore
132		n= 25 remove blink
133		n= 27 remove reverse
134		n= 3X set ANSI foreground color
135		      (see table)
136		n= 4X set ANSI background color
137		      (see table)
138
139		   X=0 black 	X=1 red
140		   X=2 green	X=3 brown
141		   X=4 blue	X=5 magenta
142		   X=6 cyan	X=7 light grey
143		   X=9 reset to the normal color
144
145--	E[s	Save cursor position			sc
146
147--	E[u	Restore	saved cursor position		rc
148
149--      E[x     Reset normal colors and attributes      --
150		to their default values
151
152--	E[nz	Switch to virtual console n		--
153
154--      E[1;nx  Set normal ANSI background color        --
155		to n (see table)
156
157--      E[2;nx  Set normal ANSI foreground color        --
158		to n (see table)
159
160--      E[3;nx  Set normal video attribute directly     --
161		to n (n	from 0 to 255)
162
163--      E[5;nx  Set normal ANSI reverse background      --
164		color to n (see	table)
165
166--      E[6;nx  Set normal ANSI reverse foreground      --
167		color to n (see	table)
168
169		   n= 0	black	   n= 8	dark grey
170		   n= 1	red	   n= 9	light red
171		   n= 2	green	   n=10	light green
172		   n= 3	brown	   n=11	yellow
173		   n= 4	blue	   n=12	light blue
174		   n= 5	magenta	   n=13	light magenta
175		   n= 6	cyan	   n=14	light cyan
176		   n= 7	light grey n=15	white
177
178--      E[7;nx  Set normal reverse video attribute      --
179		directly to n (n from 0	to 255)
180
181--	E[=p;dB	Set bell pitch (p) and duration (d),	--
182			pitch is in units of 840 nS,
183			duration is units of 0,1 S.
184
185--	E[=tC	Set global cursor type (see table)	--
186
187		   t=0 normal non-blinking
188		   t=1 normal blinking
189		   t=2 custom non-blinking
190		   t=3 custom blinking
191		   t=4 reset cursor (resets custom
192		       cursor shape and sets current
193		       cursor type to 0)
194		   t=5 hide cursor
195
196--	E[=s;eC	Set custom cursor shape, where		--
197		s is the starting and e is the ending
198		scanlines of the cursor.
199
200--	E[=s;e;dC					--
201		Same as above, except d specifies the
202		direction.  If 0, scanlines are counted
203		from the top to the bottom.  If 1, from
204		the bottom to the top.
205
206--	E[=tS	Set local cursor type (see table)	--
207
208		   t=0 normal (global)			ve
209		   t=1 invisible			vi
210		   t=2 very visible			vs
211
212--      E[=nA   Set the border color to n               --
213		(see table) (if supported by HW)
214
215--      E[=nF   Set normal foreground color to n        --
216		(see table)
217
218--      E[=nG   Set normal background color to n        --
219		(see table)
220
221--      E[=nH   Set normal reverse foreground color     --
222		to n (see table)
223
224--      E[=nI   Set normal reverse background color     --
225		to n (see table)
226
227		   n= 0	black	   n= 8	dark grey
228		   n= 1	blue	   n= 9	light blue
229		   n= 2	green	   n=10	light green
230		   n= 3	cyan	   n=11	light cyan
231		   n= 4	red	   n=12	light red
232		   n= 5	magenta	   n=13	light magenta
233		   n= 6	brown	   n=14	yellow
234		   n= 7	light grey n=15	white
235
236note: the first E in the sequences stands for ESC (0x1b)
237.Ed
238.Sh AUTHORS
239.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org
240