1 .\" $NetBSD: curses_tty.3,v 1.7 2003/06/27 13:05:08 wiz Exp $
4 .\" Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
6 .\" This code is donated to the NetBSD Foundation by the Author.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. The name of the Author may not be used to endorse or promote
17 .\" products derived from this software without specific prior written
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 .Nm reset_shell_mode ,
70 .Nd curses terminal manipulation routines
80 .Fn curs_set "int visibility"
82 .Fn def_prog_mode "void"
84 .Fn reset_prog_mode "void"
86 .Fn def_shell_mode "void"
88 .Fn reset_shell_mode "void"
94 .Fn delay_output "int ms"
106 .Fn idcok "WINDOW *win" "boolf flag"
108 .Fn idlok "WINDOW *win" "boolf flag"
110 .Fn intrflush "WINDOW *win" "boolf flag"
118 .Fn meta "WINDOW *win" "boolf flag"
140 These functions manipulate curses terminal settings.
144 function rings the terminal bell, if this is possible.
145 Failing that, the terminal screen will be flashed.
146 If neither of these are possible, then no action will be taken.
148 will flash the terminal screen if possible.
149 Failing that, the terminal bell will be rung.
150 If neither of these are possible then no action will be taken.
153 visibility can be set by calling
155 The following visibility settings are valid for
158 .Bl -tag -width visibility -compact -offset indent
164 cursor is normal visibility
166 cursor is high visibility
171 will return the previous visibility setting for the cursor.
175 function pauses the output to the terminal by sending the appropriate
176 number of terminal pad characters such that the transmission time of
177 the pad characters will take
183 will cause the current terminal curses setting to be saved.
185 .Fn reset_prog_mode ,
186 will restore the saved settings.
187 This is useful when calls to external programs are made that may
188 reset the terminal characteristics.
192 function saves the current terminal line settings.
193 These settings are the ones that will be restored when the curses
197 will save the current terminal curses settings for later restoration and
198 restores the previously saved terminal line settings.
202 function turns on curses echo mode, characters entered will be echoed
203 to the terminal by curses.
206 function disables this feature.
208 The current erase character for the terminal can be determined by
215 function discards any pending input for the current screen.
218 for the current terminal can be reset by calling
220 this will perform the initialisation on the terminal that is normally
221 done by curses at start up.
225 function returns either
229 depending on whether or not the terminal has a insert character
233 function does the same test but for a insert line capability.
235 The use of the insert character capability in curses operations can be
236 enabled or disabled by calling
238 on the desired window.
239 Similarly, the use of the insert line capability can be controlled using the
245 function controls whether or not a flush of the input buffer is
246 performed when an interrupt key (kill, suspend or quit) is pressed.
249 parameter is ignored.
252 function is equivalent to
253 .Fn intrflush stdscr FALSE .
256 function is equivalent to
257 .Fn intrflush stdscr TRUE .
259 The character that performs the line kill function can be determined
266 function turns on and off the generation of 8 bit characters by the
271 then only 7 bit characters will be returned, if
275 then 8 bit characters will be returned by the terminal.
279 causes the application to sleep for the number of milliseconds
285 will cause curses to map all carriage returns to newlines on input,
286 this functionality is enabled by default.
289 function disables this behaviour.
293 function will put the terminal into cbreak mode, which means that
294 characters will be returned one at a time instead of waiting for a
295 newline character, line discipline processing will be performed.
298 function disables this mode.
302 puts the terminal into the same mode as
304 with the exception that if no character is received within the specified
305 number of tenths of a second then the input routine will return
307 This mode can be cancelled by calling
309 The valid range for the timeout is from 1 to 255 tenths of a second.
313 function sets the input mode for the current terminal into Cooked mode,
314 that is input character translation and signal character processing is
318 function puts the terminal into Raw mode, no input character
319 translation is done nor is signal character processing.
322 tty flags can be saved by calling
324 and may be restored by calling
326 the use of these functions is discouraged as they may cause the
327 terminal to be put into a state that is incompatible with curses
330 Functions returning pointers will return
332 if an error is detected.
333 The functions that return an int will return one of the following
336 .Bl -tag -width ERR -compact
338 The function completed successfully.
340 An error occurred in the function.
350 currently have no effect on the curses code at all, currently curses
351 will always use the terminal insert character and insert line
352 capabilities if available.
356 Curses library complies with the X/Open Curses specification, part of the
357 Single Unix Specification.
359 The Curses package appeared in