chickadee » stty

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

stty

High-level interface

stty

(stty [port] settings ...)procedure

Sets the terminal attributes for PORT (defaulting to current-input-port) according to the SETTINGS, which should be a list of symbols corresponding to modes in the stty(1) man page, or one or more symbols wrapped in a (not ...) list.

To enable a character setting, use a list of the setting name followed by the character (or #f to disable), as in

     (stty '(erase #\delete))

The following settings are supported:

    clocal cread crtscts cs5 cs6 cs7 cs8 cstopb hup hupcl parenb
    parodd brkint icrnl ignbrk igncr ignpar imaxbel inpck istrip
    ixany ixoff ixon parmrk tandem ocrnl onlcr onlret onocr opost
    tab0 tab1 tab2 tab3 tabs crterase crtkill ctlecho echo echoctl
    echoe echoke echonl echoprt icanon iexten isig noflsh prterase
    tostop xcase eof eol eol2 erase intr kill lnext quit rprnt
    start stop susp werase raw sane

with-stty

with-stty '(setting ...) thunkprocedure

Sets the terminal attributes with STTY, evaluates THUNK, then restores the original attributes and returns the value from THUNK.

Example:

  (define (read-password prompt)
    (display prompt)
    (with-stty '(not echo) read-line))

Low-level interface

You shouldn't need to use this.

get-terminal-attributes #!optional port-or-fdprocedure
set-terminal-attributes! port-or-fd action attrsprocedure
make-term-attrsprocedure
free-term-attrs attrsprocedure
term-attrs-iflag attrsprocedure
term-attrs-oflag attrsprocedure
term-attrs-cflag attrsprocedure
term-attrs-lflag attrsprocedure
term-attrs-cc attrs iprocedure
term-attrs-iflag-set! attrs intprocedure
term-attrs-oflag-set! attrs intprocedure
term-attrs-cflag-set! attrs intprocedure
term-attrs-lflag-set! attrs intprocedure
term-attrs-cc-set! attrs i charprocedure

Version history

0.2.2
Bugfix release

Contents »