Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.sbin / pcvt / userkeys / vt220keys.1
1 .\" $FreeBSD: src/usr.sbin/pcvt/userkeys/vt220keys.1,v 1.7.2.3 2003/03/11 22:31:30 trhodes Exp $
2 .\" $DragonFly: src/usr.sbin/pcvt/userkeys/Attic/vt220keys.1,v 1.2 2003/06/17 04:29:59 dillon Exp $
3 .\"
4 .Dd January 16, 2001
5 .Dt VT220KEYS 1
6 .Os
7 .Sh NAME
8 .Nm vt220keys
9 .Nd "define SHIFTED function keys on VT220 terminal"
10 .Sh SYNOPSIS
11 .Nm
12 .Op Fl cil
13 .Op Ar keyname keystring ...
14 .Sh DESCRIPTION
15 The
16 .Nm
17 utility sets up a
18 .Dq "vt220 terminal"
19 in vt200 mode to allow user
20 definition of the SHIFTED function keys.
21 Each
22 .Ar keyname
23 specified on the command line will be loaded with
24 the corresponding
25 .Ar keystring .
26 A
27 .Ar keyname
28 is one of the following words:
29 .Cm F6 F7 F8 F9 F10 F11 ESC
30 .Cm F12 BS F13 LF F14 HELP
31 .Cm DO F17 F18 F19 F20 .
32 .Ar Keystrings
33 must be quoted if spaces, tabs, or shell metacharacters are included.
34 .Pp
35 The
36 .Nm
37 utility expects to receive some combination of option flags and/or
38 argument pair(s), otherwise a usage message
39 is printed.
40 .Pp
41 The options are:
42 .Bl -tag -width indent
43 .It Fl c
44 Clears all SHIFTED function key definitions before setting them to user
45 defined strings.
46 .It Fl i
47 Read the initialization file
48 .Pa $HOME/.vt220rc
49 for SHIFTED function key definitions.
50 This is done before any
51 argument pair specified on the command line is processed.
52 Each line in the file must consist of two fields (separated by spaces
53 or tabs) where the first field is the
54 .Ar keyname
55 and the second field is the
56 .Ar keystring .
57 The second field extends to the end of the line, thus a
58 .Ar keystring
59 may include spaces or tabs.
60 A newline (return) may be specified
61 within the string by using the C Language notation for newline (\\n).
62 .It Fl l
63 Locks the function keys from further definition.
64 Locking occurs after processing the initialization file (if the
65 .Fl i
66 option is specified) and any argument
67 pairs.
68 The only way
69 to unlock is by turning the power off.
70 .El
71 .Sh EXAMPLES
72 .Bd -literal
73 vt220keys -ci
74 vt220keys F6 'nroff -ms '
75 vt220keys -i F20 'cc -O -c '
76 vt220keys -l HELP man
77 .Ed
78 .Sh "OTHER FEATURES"
79 Pressing the function keys without using the shift key, generates
80 a string of characters.
81 With
82 .Xr csh 1
83 this string can be aliased to some command.
84 For example:
85 .Pp
86 .Dl alias\ ^[[17~\ "ls\ -CR\ |\ more"
87 .Pp
88 where
89 .Ql "^[[17~"
90 is what is generated by pressing the F6 key.
91 Therefore
92 F6 can perform two commands, depending if pressed with/without the SHIFT
93 key.
94 .Pp
95 The
96 .Nm
97 utility can be called from your
98 .Pa .login
99 or
100 .Pa .profile
101 file.
102 Typically an user
103 will create an initialization file and include a line like
104 .Pp
105 .Dl "vt220keys -ci"
106 OR
107 .Dl "vt220keys -cil"
108 .Pp
109 in the above mentioned files.
110 This way the SHIFTED function keys
111 will be set to your favorite commands when logging in.
112 .Sh CAVEATS
113 If the SHIFTED function keys are unlocked, redefinition of a SHIFTED
114 function key will rewrite the old string.
115 .Pp
116 There are 256 bytes available for the SHIFTED function keys.
117 Space is
118 supplied on a first\-come/first\-serve basis.
119 After the 256 bytes are
120 used, you can't define any more keys unless space is cleared.
121 This
122 can be done by redefining a key to contain a string of fewer bytes.
123 .Pp
124 All key definitions are stored in volatile RAM, and are lost when
125 terminal power is lost.
126 .Pp
127 The ESC key (unshifted) no longer generates the proper escape character.
128 This
129 is of particular importance since many editors require use of the
130 ESC key.
131 Here are some available alternatives:
132 .Bl -bullet
133 .It
134 The escape character can be generated by typing
135 .Ql ^[
136 (control\-[).
137 .It
138 Use
139 .Nm
140 as follows (note
141 .Ql ^[
142 is control\-[)
143 .Pp
144 .Dl "vt220keys ESC '^['"
145 .Pp
146 This will require you
147 to press the SHIFT key and ESC to generate the escape sequence.
148 .It
149 Some editors, allow other character(s) to be substituted for the
150 escape character.
151 For example with
152 .Xr emacs 1
153 include this line in your
154 .Pa .emacs_pro :
155 .Pp
156 .Dl (bind-to-key\ "ESC-prefix"\ "\\033[23~")
157 .Pp
158 Thus when the ESC key is pressed,
159 .Nm emacs
160 will allow the characters generated
161 .Pq Li ^[[23~
162 to perform the same function as the escape
163 character.
164 .El
165 .Sh FILES
166 .Bl -tag -width $HOME/.vt220rc
167 .It Pa $HOME/.vt220rc
168 initialization file
169 .El
170 .Sh SEE ALSO
171 .Rs
172 .%B "VT220 Programmer Reference Manual"
173 .Re
174 .Rs
175 .%B "VT220 Programmer Pocket Guide"
176 .Re