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