Skip to content

Instantly share code, notes, and snippets.

@sourcefrog
Created January 8, 2017 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sourcefrog/b35f87e986de26ffd81e9579c1dc3431 to your computer and use it in GitHub Desktop.
Save sourcefrog/b35f87e986de26ffd81e9579c1dc3431 to your computer and use it in GitHub Desktop.
Demonstrate rust term and iTerm2 problems
extern crate term;
fn main() {
let mut t = term::stdout().unwrap();
t.fg(term::color::BRIGHT_GREEN).unwrap();
t.bg(term::color::BLUE).unwrap();
write!(t, "hello 123123123123123123").unwrap();
t.carriage_return().unwrap();
t.flush().unwrap();
t.bg(term::color::BLACK).unwrap();
t.fg(term::color::WHITE).unwrap();
t.delete_line().unwrap();
write!(t, "again").unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment