.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "IO::Stty 3pm" .TH IO::Stty 3pm "2012-05-20" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" IO::Stty \- Change and print terminal line settings .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& # calling the script directly \& stty.pl [setting...] \& stty.pl {\-a,\-g,\-v,\-\-version} \& \& # Calling Stty module \& use IO::Stty; \& IO::Stty::stty(\e*TTYHANDLE, @modes); \& \& use IO::Stty; \& $old_mode=IO::Stty::stty(\e*STDIN,\*(Aq\-g\*(Aq); \& \& # Turn off echoing. \& IO::Stty::stty(\e*STDIN,\*(Aq\-echo\*(Aq); \& \& # Do whatever.. grab input maybe? \& $read_password = <>; \& \& # Now restore the old mode. \& IO::Stty::stty(\e*STDIN,$old_mode); \& \& # What settings do we have anyway? \& print IO::Stty::stty(\e*STDIN,\*(Aq\-a\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is the \s-1PERL\s0 \s-1POSIX\s0 compliant stty. .SH "INTRO" .IX Header "INTRO" This has not been tailored to the IO::File stuff but will work with it as indicated. Before you go futzing with term parameters it's a good idea to grab the current settings and restore them when you finish. .PP stty accepts the following non-option arguments that change aspects of the terminal line operation. A `[\-]' before a capability means that it can be turned off by preceding it with a `\-'. .SH "stty parameters" .IX Header "stty parameters" .SS "Control settings" .IX Subsection "Control settings" .IP "[\-]parenb" 4 .IX Item "[-]parenb" Generate parity bit in output and expect parity bit in input. .IP "[\-]parodd" 4 .IX Item "[-]parodd" Set odd parity (even with `\-'). .IP "cs5 cs6 cs7 cs8" 4 .IX Item "cs5 cs6 cs7 cs8" Set character size to 5, 6, 7, or 8 bits. .IP "[\-]hupcl [\-]hup" 4 .IX Item "[-]hupcl [-]hup" Send a hangup signal when the last process closes the tty. .IP "[\-]cstopb" 4 .IX Item "[-]cstopb" Use two stop bits per character (one with `\-'). .IP "[\-]cread" 4 .IX Item "[-]cread" Allow input to be received. .IP "[\-]clocal" 4 .IX Item "[-]clocal" Disable modem control signals. .SS "Input settings" .IX Subsection "Input settings" .IP "[\-]ignbrk" 4 .IX Item "[-]ignbrk" Ignore break characters. .IP "[\-]brkint" 4 .IX Item "[-]brkint" Breaks cause an interrupt signal. .IP "[\-]ignpar" 4 .IX Item "[-]ignpar" Ignore characters with parity errors. .IP "[\-]parmrk" 4 .IX Item "[-]parmrk" Mark parity errors (with a 255\-0\-character sequence). .IP "[\-]inpck" 4 .IX Item "[-]inpck" Enable input parity checking. .IP "[\-]istrip" 4 .IX Item "[-]istrip" Clear high (8th) bit of input characters. .IP "[\-]inlcr" 4 .IX Item "[-]inlcr" Translate newline to carriage return. .IP "[\-]igncr" 4 .IX Item "[-]igncr" Ignore carriage return. .IP "[\-]icrnl" 4 .IX Item "[-]icrnl" Translate carriage return to newline. .IP "[\-]ixon" 4 .IX Item "[-]ixon" Enable \s-1XON/XOFF\s0 flow control. .IP "[\-]ixoff" 4 .IX Item "[-]ixoff" Enable sending of stop character when the system input buffer is almost full, and start character when it becomes almost empty again. .SS "Output settings" .IX Subsection "Output settings" .IP "[\-]opost" 4 .IX Item "[-]opost" Postprocess output. .SS "Local settings" .IX Subsection "Local settings" .IP "[\-]isig" 4 .IX Item "[-]isig" Enable interrupt, quit, and suspend special characters. .IP "[\-]icanon" 4 .IX Item "[-]icanon" Enable erase, kill, werase, and rprnt special characters. .IP "[\-]echo" 4 .IX Item "[-]echo" Echo input characters. .IP "[\-]echoe, [\-]crterase" 4 .IX Item "[-]echoe, [-]crterase" Echo erase characters as backspace-space-backspace. .IP "[\-]echok" 4 .IX Item "[-]echok" Echo a newline after a kill character. .IP "[\-]echonl" 4 .IX Item "[-]echonl" Echo newline even if not echoing other characters. .IP "[\-]noflsh" 4 .IX Item "[-]noflsh" Disable flushing after interrupt and quit special characters. .Sp * Though this claims non-posixhood it is supported by the perl \s-1POSIX\s0.pm. .IP "[\-]tostop (np)" 4 .IX Item "[-]tostop (np)" Stop background jobs that try to write to the terminal. .SS "Combination settings" .IX Subsection "Combination settings" .IP "ek" 4 .IX Item "ek" Reset the erase and kill special characters to their default values. .IP "sane" 4 .IX Item "sane" Same as: .Sp .Vb 2 \& cread \-ignbrk brkint \-inlcr \-igncr icrnl \-ixoff opost \& isig icanon echo echoe echok \-echonl \-noflsh \-tostop .Ve .Sp also sets all special characters to their default values. .IP "[\-]cooked" 4 .IX Item "[-]cooked" Same as: .Sp .Vb 1 \& brkint ignpar istrip icrnl ixon opost isig icanon .Ve .Sp plus sets the eof and eol characters to their default values if they are the same as the min and time characters. With `\-', same as raw. .IP "[\-]raw" 4 .IX Item "[-]raw" Same as: .Sp .Vb 2 \& \-ignbrk \-brkint \-ignpar \-parmrk \-inpck \-istrip \-inlcr \-igncr \& \-icrnl \-ixon \-ixoff \-opost \-isig \-icanon min 1 time 0 .Ve .Sp With `\-', same as cooked. .IP "[\-]pass8" 4 .IX Item "[-]pass8" Same as: .Sp .Vb 1 \& \-parenb \-istrip cs8 .Ve .Sp With `\-', same as parenb istrip cs7. .IP "dec" 4 .IX Item "dec" Same as: .Sp .Vb 1 \& echoe echoctl echoke \-ixany .Ve .Sp Also sets the interrupt special character to Ctrl-C, erase to Del, and kill to Ctrl-U. .SS "Special characters" .IX Subsection "Special characters" The special characters' default values vary from system to system. They are set with the syntax `name value', where the names are listed below and the value can be given either literally, in hat notation (`^c'), or as an integer which may start with `0x' to indicate hexadecimal, `0' to indicate octal, or any other digit to indicate decimal. Giving a value of `^\-' or `undef' disables that special character. .IP "intr" 4 .IX Item "intr" Send an interrupt signal. .IP "quit" 4 .IX Item "quit" Send a quit signal. .IP "erase" 4 .IX Item "erase" Erase the last character typed. .IP "kill" 4 .IX Item "kill" Erase the current line. .IP "eof" 4 .IX Item "eof" Send an end of file (terminate the input). .IP "eol" 4 .IX Item "eol" End the line. .IP "start" 4 .IX Item "start" Restart the output after stopping it. .IP "stop" 4 .IX Item "stop" Stop the output. .IP "susp" 4 .IX Item "susp" Send a terminal stop signal. .SS "Special settings" .IX Subsection "Special settings" .IP "min N" 4 .IX Item "min N" Set the minimum number of characters that will satisfy a read until the time value has expired, when \-icanon is set. .IP "time N" 4 .IX Item "time N" Set the number of tenths of a second before reads time out if the min number of characters have not been read, when \-icanon is set. .IP "N" 4 .IX Item "N" Set the input and output speeds to N. N can be one of: 0 50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 exta extb. exta is the same as 19200; extb is the same as 38400. 0 hangs up the line if \-clocal is set. .SS "\s-1OPTIONS\s0" .IX Subsection "OPTIONS" .IP "\-a" 4 .IX Item "-a" Print all current settings in human-readable form. .IP "\-g" 4 .IX Item "-g" Print all current settings in a form that can be used as an argument to another stty command to restore the current settings. .IP "\-v,\-\-version" 4 .IX Item "-v,--version" Print version info. .SH "Direct Subroutines" .IX Header "Direct Subroutines" .IP "\fB\f(BIstty()\fB\fR" 4 .IX Item "stty()" .Vb 1 \& IO::Stty::stty(\e*STDIN, @params); .Ve .Sp From comments: .Sp .Vb 5 \& I\*(Aqm not feeling very inspired about this. Terminal parameters are obscure \& and boring. Basically what this will do is get the current setting, \& take the parameters, modify the setting and write it back. Zzzz. \& This is not especially efficent and probably not too fast. Assuming the POSIX \& spec has been implemented properly it should mostly work. .Ve .IP "\fB\f(BIshow_me_the_crap()\fB\fR" 4 .IX Item "show_me_the_crap()" Needs documentation .SH "AUTHOR" .IX Header "AUTHOR" Austin Schutz (Initial version and maintenance) .PP Todd Rinaldo (Maintenance) .SH "BUGS" .IX Header "BUGS" This is use at your own risk software. Do anything you want with it except blame me for it blowing up your machine because it's full of bugs. .PP See above for what functions are supported. It's mostly standard \s-1POSIX\s0 stuff. If any of the settings are wrong and you actually know what some of these extremely arcane settings (like what 'sane' should be in \s-1POSIX\s0 land) really should be, please open an \s-1RT\s0 ticket. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" None .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 1997 Austin Schutz, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.