aboutsummaryrefslogtreecommitdiffstats
path: root/test/termios2.rs
blob: a7b3aa91de99e8e78a9de7efb192125ca11485e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
extern mod term;

fn loop_chars () {
    loop {
        let ch = io::stdin().read_char();
        io::stdout().write_char(ch);
        if ch == 'q' {
            break;
        }
    }
}

fn main () {
    do term::ios::preserve {
        term::ios::raw();
        loop_chars();
    }

    loop_chars();
}