summaryrefslogtreecommitdiff
path: root/usr/src/man/man7d/wscons.7d
blob: 42870432ced0c940d3b71135baaef286f00d96da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
'\" te
.\" Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH wscons 7D "26 May 2006" "SunOS 5.11" "Devices"
.SH NAME
wscons \- workstation console
.SH SYNOPSIS
.LP
.nf
\fB#include <sys/strredir.h>\fR 
.fi

.LP
.nf
\fBioctl\fR(\fIfd\fR, SRIOCSREDIR, \fItarget\fR);
.fi

.LP
.nf
\fBioctl\fR(\fIfd\fR, SRIOCISREDIR, \fItarget\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBwscons\fR workstation console consists of a workstation keyboard and
frame buffer that act together to emulate an \fBASCII\fR terminal. It includes
a redirection facility that allows I/O issued to the workstation console to be
diverted to a STREAMS device, enabling window systems to redirect output that
would otherwise appear directly on the frame buffer in corrupted form.
.SS "Redirection"
.sp
.LP
The \fBwscons\fR redirection facility maintains a list of devices that are
designated as redirection targets through the \fBSRIOCSREDIR\fR ioctl described
below. Only the current entry is active; when the active entry is closed, the
most recent remaining entry becomes active. The active entry acts as a proxy
for the device being redirected and handles all \fBread\fR(2), \fBwrite\fR(2),
\fBioctl\fR(2), and \fBpoll\fR(2) calls issued against the redirectee.
.sp
.LP
The ioctls described below control the redirection facility. In both cases,
\fIfd\fR is a descriptor for the device being redirected (or workstation
console) and \fItarget\fR is a descriptor for a STREAMS device.
.sp
.ne 2
.mk
.na
\fB\fBSRIOCSREDIR\fR\fR
.ad
.RS 16n
.rt  
Designates \fItarget\fR as the source and destination of I/O ostensibly
directed to the device denoted by \fIfd\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fBSRIOCISREDIR\fR\fR
.ad
.RS 16n
.rt  
Returns 1 if \fItarget\fR names the device currently acting as proxy for the
device denoted by \fIfd\fR, and 0 if it is not.
.RE

.SS "ANSI Standard Terminal Emulation"
.sp
.LP
The Solaris kernel terminal emulator provides ANSI X3.64 emulation both on
SPARC and x86 systems.
.sp
.LP
On SPARC systems, the PROM monitor is used to emulate an ANSI  X3.64 terminal
if the kernel terminal emulator is not available for emulation. See
\fBvisual_io\fR(7I) for more details.
.sp
.LP
Note: The \fBVT100\fR adheres the \fBANSI\fR X3.64 standard. However, because
the \fBVT100\fR features nonstandard extensions to \fBANSI\fR X3.64, it is
incompatible with Sun terminal emulators.
.sp
.LP
The SPARC console displays 34 lines of 80 ASCII characters per line.  The x86
console displays 25 lines of 80 ASCII characters per line.  Devices with
smaller text capacities may display less. On SPARC systems, the \fBscreen-#rows
screen-#columns\fR should be set to 34 or 80 respectively or text capacities
will vary from those described above. On SPARC systems, the \fBscreen-#rows and
screen-#columns\fR fields are stored in \fBNVRAM/EEPROM\fR. See
\fBeeprom\fR(1M) for more information. Both SPARC and x86 consoles offer
scrolling, (x, y) cursor addressing ability and a number of other control
functions.
.sp
.LP
The console cursor marks the current line and character position on the screen.
\fBASCII\fR characters between \fB0x20 \fR(space) and \fB0x7E\fR (tilde)
inclusive are printing characters. When a print character is written to the
console (and is not part of an escape sequence), it is displayed at the current
cursor position and the cursor moves one position to the right on the current
line.
.sp
.LP
On SPARC based systems, later  \fBPROM\fR revisions have the full 8-bit ISO
Latin-1 (\fIISO 8859-1\fR) character set. Earlier \fBPROM\fR revisions display
characters in the range \fB0xA0 \fRthrough \fB0xFE \fRas spaces.
.sp
.LP
When the cursor is at the right edge of the screen, it moves to the first
character position on the next line.  When the cursor is at the screen's
right-bottom edge, the line-feed function is performed (see \fBCTRL-J\fR
below). The line-feed function scrolls the screen up by one or more lines
before moving the cursor to the first character position on the next line.
.SS "Control Sequence Syntax"
.sp
.LP
The \fBwscons\fR console defines a number of control sequences that may occur
during input.  When a control sequence is written to the console, it affects
one of the control functions described below. Control sequences are not
displayed on screen.
.sp
.LP
A number of control sequences (or control character functions) are of the form:
.sp
.LP
\fBCTRL-\fR\fIx\fR
.sp
.LP
 where \fIx\fR represents a singe character., such as \fBCNTRL-J\fR for a line
feed.
.sp
.LP
Other \fBANSI\fR control sequences are of the form:
.sp
.in +2
.nf
ESC [ \fIparams char\fR 
.fi
.in -2

.LP
Note -
.sp
.RS 2
Spaces are included only for readability; these characters must occur in the
given sequence without the intervening spaces.
.RE
.sp
.ne 2
.mk
.na
\fBESC\fR
.ad
.RS 10n
.rt  
\fBASCII\fR escape character (\fBESC, CTRL-[, 0x1B\fR).
.RE

.sp
.ne 2
.mk
.na
\fB[\fR
.ad
.RS 10n
.rt  
Left square bracket `[' (\fB0x5B)\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fIparams\fR\fR
.ad
.RS 10n
.rt  
Sequence of zero or more decimal numbers made up of digits between 0 and 9,
separated by semicolons. Parameters are represented by \fIn\fR in the syntax
descriptions for escape sequence functions.
.RE

.sp
.ne 2
.mk
.na
\fB\fIchar\fR\fR
.ad
.RS 10n
.rt  
Function character, which is different for each control sequence and it
represented by \fIx\fR in the syntax descriptions for control character
functions.
.RE

.sp
.LP
In the following examples of syntactically valid escape sequences, \fBESC
\fRrepresent the single \fBASCII\fR character, Escape:
.sp
.ne 2
.mk
.na
\fBESC[m\fR
.ad
.RS 22n
.rt  
Select graphic rendition with default parameter
.RE

.sp
.ne 2
.mk
.na
\fBESC[7m\fR
.ad
.RS 22n
.rt  
Select graphic rendition with reverse image
.RE

.sp
.ne 2
.mk
.na
\fBESC[33;54H\fR
.ad
.RS 22n
.rt  
Set cursor position
.RE

.sp
.ne 2
.mk
.na
\fBESC[123;456;0;;3;B\fR
.ad
.RS 22n
.rt  
Move cursor down
.RE

.sp
.LP
Syntactically valid control characters and \fBANSI\fR escape sequences that are
not currently interpreted by the console are ignored.
.sp
.LP
Each control function requires a specified number of parameters. If fewer
parameters are supplied, the remaining parameters (with certain exceptions
noted below) default  to 1. If more parameters are supplied, the first \fIn\fR
parameters are used by kernel terminal emulator. In contrast,  only the last
\fIn\fR parameters are used by PROM based emulator, where \fIn\fR is the number
required by that particular command character.
.sp
.LP
Parameters which are omitted or set to 0 are reset to the default value of 1
(with certain exceptions). For example, the command character \fBM\fR requires
one parameter. \fBESC[;M\fR, \fBESC[0M\fR, \fBESC[M\fR and
\fBESC[23;15;32;1M\fR are all equivalent to \fBESC[1M\fR and provide a
parameter value of 1.  Note that \fBESC[;5M\fR (interpreted as \fB`ESC[5M\fR')
is \fInot\fR equivalent to \fBESC[5;M\fR (interpreted as `\fBESC[5;1M\fR')
which is ultimately interpreted as `\fBESC[1M\fR').
.SS "ANSI Control Functions"
.sp
.LP
The following paragraphs specify the \fBANSI\fR control functions implemented
by the console.  Each description provides:
.RS +4
.TP
.ie t \(bu
.el o
Control sequence syntax
.RE
.RS +4
.TP
.ie t \(bu
.el o
Hexadecimal equivalent of control characters where applicable
.RE
.RS +4
.TP
.ie t \(bu
.el o
Control function name and \fBANSI\fR or Sun abbreviation (if any).
.RE
.RS +4
.TP
.ie t \(bu
.el o
Description of parameters required, if any
.RE
.RS +4
.TP
.ie t \(bu
.el o
Description of the control function
.RE
.RS +4
.TP
.ie t \(bu
.el o
Initial setting of the mode for functions that set a mode. To restore the
initial settings, use the \fBSUNRESET\fR escape sequence.
.RE
.SS "Control Character Functions"
.sp
.LP
The \fBwscons \fRcontrol character functions are:
.sp
.ne 2
.mk
.na
\fBBell (BEL),\fR
.ad
.br
.na
\fBCTRL-G\fR
.ad
.br
.na
\fB0x7\fR
.ad
.RS 22n
.rt  
Used for consoles that are not equipped with an audible bell. Current Sun
workstation models also flash the screen if the keyboard is not the console
input device.
.RE

.sp
.ne 2
.mk
.na
\fBBackspace (BS),\fR
.ad
.br
.na
\fBCTRL-H,\fR
.ad
.br
.na
\fB0x8\fR
.ad
.RS 22n
.rt  
The cursor moves one position to the left on the current line.  If it is
already at the left edge of the screen, no change takes place.
.RE

.sp
.ne 2
.mk
.na
\fBTab (TAB),\fR
.ad
.br
.na
\fBCTRL-I,\fR
.ad
.br
.na
\fB0x9\fR
.ad
.RS 22n
.rt  
The cursor moves right on the current line to the next tab stop.  The tab stops
are fixed at every multiple of eight columns. If the cursor is already at the
right edge of the screen, nothing change takes place. Otherwise, the cursor
moves right a minimum of one and a maximum of eight character positions.
.RE

.sp
.ne 2
.mk
.na
\fBLine-feed (LF),\fR
.ad
.br
.na
\fBCTRL-J,\fR
.ad
.br
.na
\fB0xA\fR
.ad
.RS 22n
.rt  
The cursor, while remaining at the same character position on the line, moves
down one line. If the cursor is at the bottom line, the screen either scrolls
up or wraps around depending on the setting of an internal variable \fIn\fR
(initially 1) . The internal variable can be changed using the \fBESC[r\fR
control sequence.  If \fIn\fR is greater than zero, the entire screen
(including the cursor) is scrolled up by \fIn\fR lines before executing the
line-feed. The top \fIn\fR lines scroll off the screen and are lost.  New blank
lines \fIn\fR scroll onto the bottom of the screen. After scrolling, move the
cursor down one line to execute the line feed.
.sp
If \fIn\fR is zero, wrap-around mode is entered. The \fBESC [ 1 r\fR exits back
to scroll mode. If a line-feed occurs on the bottom line in wrap mode, the
cursor goes to the same character position in the top line of the screen.
During line-feeds, the line that the cursor moves to is cleared and no
scrolling occurs. Wrap-around mode is not implemented in the window system.
.sp
On SPARC based systems, the speed at which the screen scrolls is dependent on
the amount of data waiting to be printed.  Whenever a scroll occurs and the
console is in normal scroll mode (\fBESC [ 1 r\fR), it scans the rest of the
data awaiting printing to see how many line-feeds occur in it.  This scan stops
when the console finds a control character from the set {\fBVT\fR, \fBFF\fR,
\fBSO\fR, \fBSI\fR, \fBDLE\fR, \fBDC1\fR, \fBDC2\fR, \fBDC3\fR, \fBDC4\fR,
\fBNAK\fR, \fBSYN\fR, \fBETB\fR, \fBCAN\fR, \fBEM\fR, \fBSUB\fR, \fBESC\fR,
\fBFS\fR, \fBGS\fR, \fBRS\fR, \fBUS\fR} .  At that point, the screen is
scrolled by \fIn\fR lines (\fIn\fR \(>= 1) and processing continues. The
scanned text is processed normally and fills in the newly created lines. As
long as escape codes or other control characters are not intermixed with the
text, this results in faster scrolling
.RE

.sp
.ne 2
.mk
.na
\fBReverse Line-feed,\fR
.ad
.br
.na
\fBCTRL-K,\fR
.ad
.br
.na
\fB0xB\fR
.ad
.RS 22n
.rt  
With kernel terminal emulator (while remaining at the same character position
on the line), the  cursor  moves down one line. However, with PROM based
emulator (while remaining at the same character position on the line), the
cursor  moves up  one line. If the cursor is already at the top line, no
change takes place.
.RE

.sp
.ne 2
.mk
.na
\fBForm-feed (FF)\fR
.ad
.br
.na
\fBCTRL-L,\fR
.ad
.br
.na
\fB0xC\fR
.ad
.RS 22n
.rt  
The cursor is positioned to the home position (upper-left corner) and the
entire screen is cleared.
.RE

.sp
.ne 2
.mk
.na
\fBReturn (CR),\fR
.ad
.br
.na
\fBCTRL-M,\fR
.ad
.br
.na
\fB0xD\fR
.ad
.RS 22n
.rt  
The cursor moves to the leftmost character position on the current line.
.RE

.SS "Escape Sequence Functions"
.sp
.LP
The \fBwscons \fRescape sequence functions are:
.sp
.ne 2
.mk
.na
\fBEscape (ESC),\fR
.ad
.br
.na
\fBCTRL-[,\fR
.ad
.br
.na
\fB0x1B\fR
.ad
.sp .6
.RS 4n
The escape character.  Escape initiates a multi-character control sequence.
.RE

.sp
.ne 2
.mk
.na
\fBInsert Character (ICH)\fR
.ad
.br
.na
\fBESC[#@\fR
.ad
.sp .6
.RS 4n
Takes one parameter, \fIn\fR (default 1).  Inserts \fIn\fR spaces at the
current cursor position.  The current line, starting at the current cursor
position inclusive, is shifted to the right by \fIn\fR character positions to
make room for the spaces.  The rightmost  \fIn\fR character positions shift off
the line and are lost. The position of the cursor is unchanged.
.RE

.sp
.ne 2
.mk
.na
\fBCursor Up (CUU),\fR
.ad
.br
.na
\fBESC[#A\fR
.ad
.sp .6
.RS 4n
Takes one parameter, \fIn\fR (default 1).  Moves the cursor up \fIn\fR lines.
If the cursor is fewer than  \fIn\fR lines from the top of the screen, moves
the cursor to the topmost line on the screen.  The character position of the
cursor on the line is unchanged.
.RE

.sp
.ne 2
.mk
.na
\fBCursor Down (CUD),\fR
.ad
.br
.na
\fBESC[#B\fR
.ad
.sp .6
.RS 4n
Takes one parameter,  (default 1).  Moves the cursor down  \fIn\fR lines. If
the cursor is fewer than  \fIn\fR lines from the bottom of the screen, move the
cursor to the last line on the screen.  The character position of the cursor on
the line is unchanged.
.RE

.sp
.ne 2
.mk
.na
\fBCursor Forward (CUF),\fR
.ad
.br
.na
\fBESC[#C\fR
.ad
.sp .6
.RS 4n
Takes one parameter, \fIn\fR (default 1).  Moves the cursor to the right by
\fIn\fR character positions on the current line.  If the cursor is fewer than
\fIn\fR positions from the right edge of the screen, moves the cursor to the
rightmost position on the current line.
.RE

.sp
.ne 2
.mk
.na
\fBCursor Backward (CUB),\fR
.ad
.br
.na
\fBESC[#D\fR
.ad
.sp .6
.RS 4n
Takes one parameter, \fIn\fR (default 1).  Moves the cursor to the left by
\fIn\fR character positions on the current line.  If the cursor is fewer than
\fIn\fR positions from the left edge of the screen, moves the cursor to the
leftmost position on the current line.
.RE

.sp
.ne 2
.mk
.na
\fBCursor Next Line (CNL),\fR
.ad
.br
.na
\fBESC[#E\fR
.ad
.sp .6
.RS 4n
Takes one parameter,  \fIn\fR (default 1).  Positions the cursor at the
leftmost character position on the \fIn\fR-th line below the current line. If
the current line is less than \fIn\fR lines from the bottom of the screen,
positions the cursor at the leftmost character position on the bottom line.
.RE

.sp
.ne 2
.mk
.na
\fBHorizontal and Vertical Position (HVP),\fR
.ad
.br
.na
\fBESC[#1;#2f\fR
.ad
.sp .6
.RS 4n
or
.RE

.sp
.ne 2
.mk
.na
\fBCursor Position (CUP),\fR
.ad
.br
.na
\fBESC[#1;#2H\fR
.ad
.sp .6
.RS 4n
Takes two parameters, \fIn\fR1 and \fIn\fR2 (default 1, 1).  Moves the cursor
to the \fIn\fR2-th character position on the \fIn\fR1-th line.  Character
positions are numbered from 1 at the left edge of the screen; line positions
are numbered from 1 at the top of the screen.  Hence, if both parameters are
omitted, the default action moves the cursor to the home position (upper left
corner).  If only one parameter is supplied, the cursor moves to column 1 of
the specified line.
.RE

.sp
.ne 2
.mk
.na
\fBErase in Display (ED),\fR
.ad
.br
.na
\fBESC[J\fR
.ad
.sp .6
.RS 4n
Takes no parameters.  Erases from the current cursor position inclusive to the
end of the screen, that is, to the end of the current line and all lines below
the current line.  The cursor position is unchanged.
.RE

.sp
.ne 2
.mk
.na
\fBErase in Line (EL),\fR
.ad
.br
.na
\fBESC[K\fR
.ad
.sp .6
.RS 4n
Takes no parameters.  Erases from the current cursor position inclusive to the
end of the current line.  The cursor position is unchanged.
.RE

.sp
.ne 2
.mk
.na
\fBInsert Line (IL),\fR
.ad
.br
.na
\fBESC[#L\fR
.ad
.sp .6
.RS 4n
Takes one parameter, \fIn\fR (default 1).  Makes room for \fIn\fR new lines
starting at the current line by scrolling down by  \fIn\fR lines the portion of
the screen from the current line inclusive to the bottom.  The  \fIn\fR new
lines at the cursor are filled with spaces; the bottom  \fIn\fR lines shift off
the bottom of the screen and are lost.  The position of the cursor on the
screen is unchanged.
.RE

.sp
.ne 2
.mk
.na
\fBDelete Line (DL),\fR
.ad
.br
.na
\fBESC[#M\fR
.ad
.sp .6
.RS 4n
Takes one parameter,  \fIn\fR (default 1).  Deletes \fIn\fR lines beginning
with the current line. The portion of the screen from the current line
inclusive to the bottom is scrolled upward by  \fIn\fR lines.  The  \fIn\fR new
lines scrolling onto the bottom of the screen are filled with spaces; the
\fIn\fR old lines beginning at the cursor line are deleted.  The position of
the cursor on the screen is unchanged.
.RE

.sp
.ne 2
.mk
.na
\fBDelete Character (DCH),\fR
.ad
.br
.na
\fBESC[#P\fR
.ad
.sp .6
.RS 4n
Takes one parameter,  \fIn\fR (default 1).  Deletes  \fIn\fR characters
starting with the current cursor position.  Shifts the tail of the current line
to the left by  \fIn\fR character positions from the current cursor position,
inclusive, to the end of the line.  Blanks are shifted into the rightmost
\fIn\fR character positions.  The position of the cursor on the screen is
unchanged.
.RE

.sp
.ne 2
.mk
.na
\fBSelect Graphic Rendition (SGR),\fR
.ad
.br
.na
\fBESC[#m\fR
.ad
.sp .6
.RS 4n
Takes one parameter,  \fIn\fR (default 0).  Note that unlike most escape
sequences, the parameter defaults to zero if omitted.  Invokes the graphic
rendition specified by the parameter.  All following printing characters in the
data stream are rendered according to the parameter until the next occurrence
of this escape sequence in the data stream. With PROM-based emulator, only two
graphic renditions are defined:
.sp
.ne 2
.mk
.na
\fB0\fR
.ad
.RS 5n
.rt  
Normal rendition
.RE

.sp
.ne 2
.mk
.na
\fB7\fR
.ad
.RS 5n
.rt  
Negative (reverse) image
.RE

Negative image displays characters as white-on-black if the screen mode is
currently black-on white, and vice-versa. Any non-zero value of  \fIn\fR is
currently equivalent to 7 and selects the negative image rendition.
.sp
In addition to the two renditions mentioned above, the following\fI ISO
6429-1983\fR graphic rendition values support color text with kernel terminal
emulator:
.sp
.ne 2
.mk
.na
\fB30\fR
.ad
.RS 6n
.rt  
black foreground
.RE

.sp
.ne 2
.mk
.na
\fB31\fR
.ad
.RS 6n
.rt  
red foreground
.RE

.sp
.ne 2
.mk
.na
\fB32\fR
.ad
.RS 6n
.rt  
green foreground
.RE

.sp
.ne 2
.mk
.na
\fB33\fR
.ad
.RS 6n
.rt  
brown foreground
.RE

.sp
.ne 2
.mk
.na
\fB34\fR
.ad
.RS 6n
.rt  
blue foreground
.RE

.sp
.ne 2
.mk
.na
\fB35\fR
.ad
.RS 6n
.rt  
magenta foreground
.RE

.sp
.ne 2
.mk
.na
\fB36\fR
.ad
.RS 6n
.rt  
cyan foreground
.RE

.sp
.ne 2
.mk
.na
\fB37\fR
.ad
.RS 6n
.rt  
white foreground
.RE

.sp
.ne 2
.mk
.na
\fB40\fR
.ad
.RS 6n
.rt  
black background
.RE

.sp
.ne 2
.mk
.na
\fB41\fR
.ad
.RS 6n
.rt  
red background
.RE

.sp
.ne 2
.mk
.na
\fB42\fR
.ad
.RS 6n
.rt  
green background
.RE

.sp
.ne 2
.mk
.na
\fB43\fR
.ad
.RS 6n
.rt  
brown background
.RE

.sp
.ne 2
.mk
.na
\fB44\fR
.ad
.RS 6n
.rt  
blue background
.RE

.sp
.ne 2
.mk
.na
\fB45\fR
.ad
.RS 6n
.rt  
magenta background
.RE

.sp
.ne 2
.mk
.na
\fB46\fR
.ad
.RS 6n
.rt  
cyan background
.RE

.sp
.ne 2
.mk
.na
\fB47\fR
.ad
.RS 6n
.rt  
white background
.RE

.RE

.sp
.ne 2
.mk
.na
\fBBlack On White (SUNBOW),\fR
.ad
.br
.na
\fBESC[p\fR
.ad
.sp .6
.RS 4n
Takes no parameters.  On SPARC, sets the screen mode to black-on-white.  If the
screen mode is already black-on-white, has no effect. In this mode, spaces
display as solid white, other characters as black-on-white. The cursor is a
solid black block. Characters displayed in negative image rendition (see
`Select Graphic Rendition' above) are white-on-black. This comprises the
initial setting of the screen mode on reset. On x86 systems, use \fBESC[q\fR to
set black-on-white.
.RE

.sp
.ne 2
.mk
.na
\fBWhite On Black (SUNWOB),\fR
.ad
.br
.na
\fBESC[q\fR
.ad
.sp .6
.RS 4n
Takes no parameters.  On SPARC, sets the screen mode to white-on-black.  If the
screen mode is already white-on-black, has no effect. In this mode spaces
display as solid black, other characters as white-on-black.  The cursor is a
solid white block.  Characters displayed in negative image rendition (see
`Select Graphic Rendition' above) are black-on-white.  Initial setting of the
screen mode on reset is black on white. On x86 systems, use \fBESC[p\fR to set
white-on-black.
.RE

.sp
.ne 2
.mk
.na
\fBESC[#r\fR
.ad
.br
.na
\fBSet Scrolling (SUNSCRL)\fR
.ad
.sp .6
.RS 4n
Takes one parameter,  \fIn\fR (default 0). Sets to  \fIn\fR an internal
register which determines how many lines the screen scrolls up when a line-feed
function is performed with the cursor on the bottom line.  A parameter of 2 or
3 introduces a small amount of jump when a scroll occurs.  A parameter of 34
clears the screen rather than scrolling.  The initial setting is 1 on reset.
.sp
A parameter of zero initiates wrap mode instead of scrolling.  If a linefeed
occurs on the bottom line during wrap mode, the cursor goes to the same
character position in the top line of the screen. When a line feed occurs, the
line that the cursor moves to is cleared and no scrolling occurs. \fBESC [ 1
r\fR exits back to scroll mode.
.sp
For more information, see the description of the Line-feed (\fBCTRL-J\fR)
control function above.
.RE

.sp
.ne 2
.mk
.na
\fBESC[s\fR
.ad
.br
.na
\fBReset terminal emulator (SUNRESET)\fR
.ad
.sp .6
.RS 4n
Takes no parameters.  Resets all modes to default, restores current font from
\fBPROM.\fR Screen and cursor position are unchanged.
.RE

.SH RETURN VALUES
.sp
.LP
When there are no errors, the redirection ioctls have return values as
described above. Otherwise, they return  \fB\(mi1\fR and set \fBerrno\fR to
indicate the error. If the target stream is in an error state, \fBerrno \fRis
set accordingly.
.sp
.LP
If the \fItarget\fR stream is in an error state, \fBerrno\fR is set
accordingly.
.SH ERRORS
.sp
.ne 2
.mk
.na
\fB\fBEBADF\fR\fR
.ad
.RS 10n
.rt  
\fItarget\fR does not denote an open file.
.RE

.sp
.ne 2
.mk
.na
\fB\fBENOSTR\fR\fR
.ad
.RS 10n
.rt  
\fItarget\fR does not denote a \fBSTREAMS\fR device.
.RE

.SH FILES
.sp
.ne 2
.mk
.na
\fB\fB/dev/wscons\fR\fR
.ad
.RS 16n
.rt  
Workstation console, accessed via the redirection facility
.RE

.sp
.ne 2
.mk
.na
\fB\fB/dev/systty\fR\fR
.ad
.RS 16n
.rt  
Devices that must be opened for the \fBSRIOCSREDIR\fR and \fBSRIOCISREDIR\fR
ioctls.
.RE

.sp
.ne 2
.mk
.na
\fB\fB/dev/syscon\fR\fR
.ad
.RS 16n
.rt  
Access system console
.RE

.sp
.ne 2
.mk
.na
\fB\fB/dev/console\fR\fR
.ad
.RS 16n
.rt  
Access system console
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityStable
.TE

.SH SEE ALSO
.sp
.LP
\fBcvcd\fR(1M), \fBeeprom\fR(1M), \fBioctl\fR(2), \fBpoll\fR(2), \fBread\fR(2),
\fBwrite\fR(2), \fBcvc\fR(7D), \fBconsole\fR(7D), \fBvisual_io\fR(7I)
.SH WARNINGS
.sp
.LP
The redirection ioctls block while there is I/O outstanding on the device
instance being redirected. If you try to redirect the workstation console while
there is a outstanding read, the workstation console will hang until the read
completes.
.SH NOTES
.sp
.LP
The \fBcvc \fRfacility supersedes the SunOS \fBwscons \fRfacility and should
not be used with \fBwscons\fR.