Add readine-like behaviour for \x17, \x04 in input layer.
[screen-lua.git] / src / comm.c
blob1f61205b6aeecc248f41b0ce42190dcac9196d74
1 /* Copyright (c) 1993-2002
2 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
3 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
4 * Copyright (c) 1987 Oliver Laumann
6 #ifdef HAVE_BRAILLE
7 * Modified by:
8 * Authors: Hadi Bargi Rangin bargi@dots.physics.orst.edu
9 * Bill Barry barryb@dots.physics.orst.edu
11 * Modifications Copyright (c) 1995 by
12 * Science Access Project, Oregon State University.
13 #endif
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program (see the file COPYING); if not, write to the
27 * Free Software Foundation, Inc.,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
30 ****************************************************************
33 #include "config.h"
34 #include "acls.h"
35 #include "comm.h"
37 #define bcopy :-( /* or include screen.h here */
39 /* Must be in alpha order ! */
41 struct comm comms[RC_LAST + 1] =
43 #ifdef MULTIUSER
44 { "acladd", ARGS_1234 },
45 { "aclchg", ARGS_23 },
46 { "acldel", ARGS_1 },
47 { "aclgrp", ARGS_12 },
48 { "aclumask", ARGS_1|ARGS_ORMORE },
49 #endif
50 { "activity", ARGS_1 },
51 #ifdef MULTIUSER
52 { "addacl", ARGS_1234 },
53 #endif
54 { "allpartial", NEED_DISPLAY|ARGS_1 },
55 { "altscreen", ARGS_01 },
56 { "at", NEED_DISPLAY|ARGS_2|ARGS_ORMORE },
57 #ifdef COLOR
58 { "attrcolor", ARGS_12 },
59 #endif
60 { "autodetach", ARGS_1 },
61 #ifdef AUTO_NUKE
62 { "autonuke", NEED_DISPLAY|ARGS_1 },
63 #endif
64 { "backtick", ARGS_1|ARGS_ORMORE },
65 #ifdef COLOR
66 { "bce", NEED_FORE|ARGS_01 },
67 #endif
69 #ifdef HAVE_BRAILLE
70 /* keywords for braille display (bd) */
71 { "bd_bc_down", ARGS_0 },
72 { "bd_bc_left", ARGS_0 },
73 { "bd_bc_right", ARGS_0 },
74 { "bd_bc_up", ARGS_0 },
75 { "bd_bell", ARGS_01 },
76 { "bd_braille_table", ARGS_01 },
77 { "bd_eightdot", ARGS_01 },
78 { "bd_info", ARGS_01 },
79 { "bd_link", ARGS_01 },
80 { "bd_lower_left", ARGS_0 },
81 { "bd_lower_right", ARGS_0 },
82 { "bd_ncrc", ARGS_01 },
83 { "bd_port", ARGS_01 },
84 { "bd_scroll", ARGS_01 },
85 { "bd_skip", ARGS_01 },
86 { "bd_start_braille", ARGS_01 },
87 { "bd_type", ARGS_01 },
88 { "bd_upper_left", ARGS_0 },
89 { "bd_upper_right", ARGS_0 },
90 { "bd_width", ARGS_01 },
91 #endif
93 { "bell", ARGS_01 },
94 { "bell_msg", ARGS_01 },
95 { "bind", ARGS_1|ARGS_ORMORE },
96 #ifdef MAPKEYS
97 { "bindkey", ARGS_0|ARGS_ORMORE },
98 #endif
99 { "blanker", NEED_DISPLAY|ARGS_0},
100 #ifdef BLANKER_PRG
101 { "blankerprg", ARGS_1|ARGS_ORMORE },
102 #endif
103 { "break", NEED_FORE|ARGS_01 },
104 { "breaktype", NEED_FORE|ARGS_01 },
105 #ifdef COPY_PASTE
106 { "bufferfile", ARGS_01 },
107 #endif
108 { "c1", NEED_FORE|ARGS_01 },
109 { "caption", ARGS_12 },
110 #ifdef MULTIUSER
111 { "chacl", ARGS_23 },
112 #endif
113 { "charset", NEED_FORE|ARGS_1 },
114 { "chdir", ARGS_01 },
115 { "clear", NEED_FORE|ARGS_0 },
116 { "colon", NEED_LAYER|ARGS_01 },
117 { "command", NEED_DISPLAY|ARGS_02 },
118 #ifdef COPY_PASTE
119 { "compacthist", ARGS_01 },
120 #endif
121 { "console", NEED_FORE|ARGS_01 },
122 #ifdef COPY_PASTE
123 { "copy", NEED_FORE|NEED_DISPLAY|ARGS_0 },
124 { "crlf", ARGS_01 },
125 #endif
126 { "debug", ARGS_01 },
127 #ifdef AUTO_NUKE
128 { "defautonuke", ARGS_1 },
129 #endif
130 #ifdef COLOR
131 { "defbce", ARGS_1 },
132 #endif
133 { "defbreaktype", ARGS_01 },
134 { "defc1", ARGS_1 },
135 { "defcharset", ARGS_01 },
136 #ifdef ENCODINGS
137 { "defencoding", ARGS_1 },
138 #endif
139 { "defescape", ARGS_1 },
140 { "defflow", ARGS_12 },
141 { "defgr", ARGS_1 },
142 { "defhstatus", ARGS_01 },
143 #ifdef ENCODINGS
144 { "defkanji", ARGS_1 },
145 #endif
146 { "deflog", ARGS_1 },
147 #if defined(UTMPOK) && defined(LOGOUTOK)
148 { "deflogin", ARGS_1 },
149 #endif
150 { "defmode", ARGS_1 },
151 { "defmonitor", ARGS_1 },
152 #ifdef MULTI
153 { "defnonblock", ARGS_1 },
154 #endif
155 { "defobuflimit", ARGS_1 },
156 #ifdef COPY_PASTE
157 { "defscrollback", ARGS_1 },
158 #endif
159 { "defshell", ARGS_1 },
160 { "defsilence", ARGS_1 },
161 { "defslowpaste", ARGS_1 },
162 #ifdef UTF8
163 { "defutf8", ARGS_1 },
164 #endif
165 { "defwrap", ARGS_1 },
166 { "defwritelock", ARGS_1 },
167 #ifdef DETACH
168 { "detach", NEED_DISPLAY|ARGS_01 },
169 #endif
170 { "digraph", NEED_LAYER|ARGS_01 },
171 { "dinfo", NEED_DISPLAY|ARGS_0 },
172 { "displays", NEED_LAYER|ARGS_0 },
173 { "dumptermcap", NEED_FORE|ARGS_0 },
174 { "echo", ARGS_12 },
175 #ifdef ENCODINGS
176 { "encoding", ARGS_12 },
177 #endif
178 { "escape", ARGS_1 },
179 { "eval", ARGS_1|ARGS_ORMORE },
180 #ifdef PSEUDOS
181 { "exec", NEED_FORE|ARGS_0|ARGS_ORMORE },
182 #endif
183 { "fit", NEED_DISPLAY|ARGS_0 },
184 { "flow", NEED_FORE|ARGS_01 },
185 { "focus", NEED_DISPLAY|ARGS_01 },
186 { "focusminsize", ARGS_02 },
187 { "gr", NEED_FORE|ARGS_01 },
188 { "group", NEED_FORE|ARGS_01 },
189 { "hardcopy", ARGS_012 },
190 { "hardcopy_append", ARGS_1 },
191 { "hardcopydir", ARGS_01 },
192 { "hardstatus", ARGS_012 },
193 { "height", ARGS_0123 },
194 { "help", NEED_LAYER|ARGS_02 },
195 #ifdef COPY_PASTE
196 { "history", NEED_DISPLAY|NEED_FORE|ARGS_0 },
197 #endif
198 { "hstatus", NEED_FORE|ARGS_1 },
199 { "idle", ARGS_0|ARGS_ORMORE },
200 { "ignorecase", ARGS_01 },
201 { "info", NEED_LAYER|ARGS_0 },
202 #ifdef ENCODINGS
203 { "kanji", NEED_FORE|ARGS_12 },
204 #endif
205 { "kill", NEED_FORE|ARGS_0 },
206 { "lastmsg", NEED_DISPLAY|ARGS_0 },
207 { "layout", ARGS_1|ARGS_ORMORE},
208 { "license", NEED_LAYER|ARGS_0 },
209 #ifdef LOCK
210 { "lockscreen", NEED_DISPLAY|ARGS_0 },
211 #endif
212 { "log", NEED_FORE|ARGS_01 },
213 { "logfile", ARGS_012 },
214 #if defined(UTMPOK) && defined(LOGOUTOK)
215 { "login", NEED_FORE|ARGS_01 },
216 #endif
217 { "logtstamp", ARGS_012 },
218 #ifdef MAPKEYS
219 { "mapdefault", NEED_DISPLAY|ARGS_0 },
220 { "mapnotnext", NEED_DISPLAY|ARGS_0 },
221 { "maptimeout", ARGS_01 },
222 #endif
223 #ifdef COPY_PASTE
224 { "markkeys", ARGS_1 },
225 #endif
226 { "maxwin", ARGS_1 },
227 { "meta", NEED_LAYER|ARGS_0 },
228 { "monitor", NEED_FORE|ARGS_01 },
229 { "msgminwait", ARGS_1 },
230 { "msgwait", ARGS_1 },
231 #ifdef MULTIUSER
232 { "multiuser", ARGS_1 },
233 #endif
234 #ifdef NETHACK
235 { "nethack", ARGS_1 },
236 #endif
237 { "next", ARGS_0 },
238 #ifdef MULTI
239 { "nonblock", NEED_DISPLAY|ARGS_01 },
240 #endif
241 { "number", NEED_FORE|ARGS_01 },
242 { "obuflimit", NEED_DISPLAY|ARGS_01 },
243 { "only", NEED_DISPLAY|ARGS_0 },
244 { "other", ARGS_0 },
245 { "partial", NEED_FORE|ARGS_01 },
246 #ifdef PASSWORD
247 { "password", ARGS_01 },
248 #endif
249 #ifdef COPY_PASTE
250 { "paste", NEED_LAYER|ARGS_012 },
251 { "pastefont", ARGS_01 },
252 #endif
253 { "pow_break", NEED_FORE|ARGS_01 },
254 #if defined(DETACH) && defined(POW_DETACH)
255 { "pow_detach", NEED_DISPLAY|ARGS_0 },
256 { "pow_detach_msg", ARGS_01 },
257 #endif
258 { "prev", ARGS_0 },
259 { "printcmd", ARGS_01 },
260 { "process", NEED_DISPLAY|ARGS_01 },
261 { "quit", ARGS_0 },
262 #ifdef COPY_PASTE
263 { "readbuf", ARGS_0123 },
264 #endif
265 { "readreg", ARGS_0|ARGS_ORMORE },
266 { "redisplay", NEED_DISPLAY|ARGS_0 },
267 { "register", ARGS_24 },
268 { "remove", NEED_DISPLAY|ARGS_0 },
269 #ifdef COPY_PASTE
270 { "removebuf", ARGS_0 },
271 #endif
272 { "reset", NEED_FORE|ARGS_0 },
273 { "resize", NEED_DISPLAY|ARGS_0|ARGS_ORMORE },
274 { "screen", ARGS_0|ARGS_ORMORE },
275 #ifdef COPY_PASTE
276 { "scrollback", NEED_FORE|ARGS_1 },
277 #endif
278 { "select", ARGS_01 },
279 { "sessionname", ARGS_01 },
280 { "setenv", ARGS_012 },
281 { "setsid", ARGS_1 },
282 { "shell", ARGS_1 },
283 { "shelltitle", ARGS_1 },
284 { "silence", NEED_FORE|ARGS_01 },
285 { "silencewait", ARGS_1 },
286 { "sleep", ARGS_1 },
287 { "slowpaste", NEED_FORE|ARGS_01 },
288 { "sorendition", ARGS_012 },
289 { "source", ARGS_1 },
290 { "split", NEED_DISPLAY|ARGS_01 },
291 { "startup_message", ARGS_1 },
292 { "stuff", NEED_LAYER|ARGS_12 },
293 #ifdef MULTIUSER
294 { "su", NEED_DISPLAY|ARGS_012 },
295 #endif
296 #ifdef BSDJOBS
297 { "suspend", NEED_DISPLAY|ARGS_0 },
298 #endif
299 { "term", ARGS_1 },
300 { "termcap", ARGS_23 },
301 { "termcapinfo", ARGS_23 },
302 { "terminfo", ARGS_23 },
303 { "time", ARGS_01 },
304 { "title", NEED_FORE|ARGS_01 },
305 { "umask", ARGS_1|ARGS_ORMORE },
306 { "unsetenv", ARGS_1 },
307 #ifdef UTF8
308 { "utf8", NEED_FORE|ARGS_012 },
309 #endif
310 { "vbell", ARGS_01 },
311 { "vbell_msg", ARGS_01 },
312 { "vbellwait", ARGS_1 },
313 { "verbose", ARGS_01 },
314 { "version", ARGS_0 },
315 { "wall", NEED_DISPLAY|ARGS_1},
316 { "width", ARGS_0123 },
317 { "windowlist", ARGS_012 },
318 { "windows", NEED_DISPLAY|ARGS_0 },
319 { "wrap", NEED_FORE|ARGS_01 },
320 #ifdef COPY_PASTE
321 { "writebuf", ARGS_0123 },
322 #endif
323 { "writelock", NEED_FORE|ARGS_01 },
324 { "xoff", NEED_LAYER|ARGS_0 },
325 { "xon", NEED_LAYER|ARGS_0 },
326 #ifdef ZMODEM
327 { "zmodem", ARGS_012 },
328 #endif
329 { "zombie", ARGS_012 }