Version 2 of stty

Updated 2008-11-27 11:18:52 by dkf

This Unix-ish command is used to communicate information from a script level program to a terminal device. It allows one to read and modify the various device attributes.

Tcl developers often make use of it on Linux or other Unix systems when they want to collect data from user input without requiring the user to press Return first.

It's also useful for prompting for passwords:

proc getpassword {{prompt "Password: "}} {
    puts -nonewline $prompt
    flush stdout
    # disable echoing
    exec stty -echo
    catch { gets stdin } password options
    exec stty echo
    return -options $options $password
}