aboutsummaryrefslogblamecommitdiffstats
path: root/test/termios2.rs
blob: a7b3aa91de99e8e78a9de7efb192125ca11485e9 (plain) (tree)
1
2
3
4
5
6
                
 
                  


                                         






                      
                            
                         
                     
     

                 
 
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();
}