PackageTrack
Sign in Get early access

termion

A bindless library for manipulating terminals.

4.0.6 12M downloads/mo #2798 most downloaded on crates.io source

What this package is like to depend on

Last release 9 months ago

21 Nov 2025

Release timing varies

gaps range from 5 weeks to 1.7 years

Some releases are documented

notes for 9 of 36 stable releases

1 version withdrawn

withdrawn after publishing

10 years old

37 releases · first in 2016

1 release in the last 12 months

see the full history below

Release timeline

37 releases · Jul 2016 to Nov 2025
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 37
  1. 4.0.6 21 Nov 2025
    Release notes
    • Drop Redox-specific code, now that it supports all libc functions
    Open source →
  2. 4.0.5 31 Mar 2025
    Release notes
    • Add helpers to get terminal size from file descriptor
    Open source →
  3. 4.0.4 24 Feb 2025
    Release notes
    • Remove debug printing when parsing CSI sequences
    • Support NO_COLOR environment variable
    Open source →
    Release notes
    • Remove debug printing when parsing CSI sequences

    • Support NO_COLOR environment variable

    Open source →
  4. 4.0.3 06 Oct 2024
    Release notes

    Remove unused code and update dependencies.

    Open source →
  5. 4.0.2 12 Jun 2024
    Release notes

    Fixes an error check in Ctrl-Arrow code, no difference in behavior. Cleaned up examples.

    Open source →
  6. 4.0.1 11 Jun 2024
    Release notes

    Fixes a regression in function keys F5 and above.

    Open source →
  7. 4.0.0 06 May 2024
    Release notes

    4.0.0 adds support for horizontal scrolling when working with MouseTerminal.

    3.0.0 to 4.0.0 guide

    A change is only necessary if you were matching on all variants of the MouseEvent enum without a wildcard. In this case, you need to either handle the two new variants, MouseLeft and MouseRight, or add a wildcard.

    Open source →
    Release notes

    4.0.0 adds support for horizontal scrolling when working with MouseTerminal .

    3.0.0 to 4.0.0 guide

    A change is only necessary if you were matching on all variants of the MouseEvent enum without a wildcard. In this case, you need to either handle the two new variants, MouseLeft and MouseRight , or add a wildcard.

    Open source →
  8. 3.0.0 05 Jan 2024
    Release notes

    v3 release improves raw terminal API and enables support of any TTY target.

    2.0.0 to 3.0.0 guide

    Changes are only required if you were using IntoRawMode on generic terminals W: Write. Now, terminal is also required to implement AsFd trait. So replacing generic bounds with W: Write + AsFd should be sufficient.

    Open source →
    Release notes

    v3 release improves raw terminal API and enables support of any TTY target.

    2.0.0 to 3.0.0 guide

    Changes are only required if you were using IntoRawMode on generic terminals W: Write . Now, terminal is also required to implement AsFd trait . So replacing generic bounds with W: Write + AsFd should be sufficient.

    Open source →
  9. 2.0.3 04 Nov 2023

    Nothing published for this version

  10. 2.0.2 04 Nov 2023

    Nothing published for this version

  11. 2.0.1 21 Oct 2022

    Nothing published for this version

  12. 2.0.0 21 Oct 2022

    Nothing published for this version

  13. 1.6.0 21 Oct 2022 withdrawn

    Nothing published for this version

  14. 1.5.6 26 Jan 2021

    Nothing published for this version

  15. 1.5.5 20 Jan 2020

    Nothing published for this version

  16. 1.5.4 29 Nov 2019

    Nothing published for this version

  17. 1.5.3 12 Jun 2019

    Nothing published for this version

  18. 1.5.2 21 Apr 2019

    Nothing published for this version

  19. 1.5.1 03 Aug 2017

    Nothing published for this version

  20. 1.5.0 24 Jul 2017

    Nothing published for this version

  21. 1.4.0 10 Jun 2017

    Nothing published for this version

  22. 1.3.0 24 Mar 2017

    Nothing published for this version

  23. 1.2.0 26 Feb 2017

    Nothing published for this version

  24. 1.1.4 18 Dec 2016

    Nothing published for this version

  25. 1.1.3 06 Nov 2016

    Nothing published for this version

  26. 1.1.2 26 Oct 2016

    Nothing published for this version

  27. 1.1.1 24 Sep 2016

    Nothing published for this version

  28. 1.1.0 24 Sep 2016

    Nothing published for this version

  29. 1.0.8 07 Sep 2016

    Nothing published for this version

  30. 1.0.7 07 Sep 2016

    Nothing published for this version

  31. 1.0.6 27 Aug 2016

    Nothing published for this version

  32. 1.0.5 01 Aug 2016

    Nothing published for this version

  33. 1.0.4 29 Jul 2016

    Nothing published for this version

  34. 1.0.3 24 Jul 2016

    Nothing published for this version

  35. 1.0.2 24 Jul 2016

    Nothing published for this version

  36. 1.0.1 24 Jul 2016

    Nothing published for this version

  37. 1.0.0 23 Jul 2016
    Release notes

    Termion 1.0.0 is out! This release is breaking, which is also the reason for the semver bump.

    Highlights

    Lot'ta goodies.

    • Mouse support: If you enabled mouse mode through the MouseTerminal struct, you can get mouse events (thanks to IGI-111).
    • TrueColor support: You can now use true color, by the Rgb struct.
    • A complete revision of the way escapes are handled: Everything is now done through Display instead of custom traits.
    • isatty wrapper: termion::is_tty takes any T: AsRawFd and gives you a bool.
    • Crates.io release: Previously, it was distributed solely through git. This turns out to be very convinient, but quite critical whenever making breaking changes (that is, major semver bumps).

    0.1.0 to 1.0.0 guide

    This sample table gives an idea of how to go bu converting to the new major version of Termion.

    0.1.0 1.0.0
    use termion::IntoRawMode use termion::raw::IntoRawMode
    stdout.color(color::Red); write!(stdout, "{}", color::Fg(color::Red));
    stdout.color_bg(color::Red); write!(stdout, "{}", color::Bg(color::Red));
    stdout.goto(x, y); write!(stdout, "{}", cursor::Goto(x, y));
    color::rgb(r, g, b); color::Rgb(r, g, b) (truecolor)
    x.with_mouse() MouseTerminal::from(x)

    An example

    #![feature(step_by)]
    
    extern crate termion;
    
    use termion::event::Key;
    use termion::input::TermRead;
    use termion::raw::IntoRawMode;
    use std::io::{Write, stdout, stdin};
    
    fn rainbow<W: Write>(stdout: &mut W, blue: u8) {
        write!(stdout, "{}{}", termion::cursor::Goto(1, 1), termion::clear::All).unwrap();
    
        for red in (0..255).step_by(8 as u8) {
            for green in (0..255).step_by(4) {
                write!(stdout, "{} ", termion::color::Bg(termion::color::Rgb(red, green, blue))).unwrap();
            }
            write!(stdout, "\n\r").unwrap();
        }
    
        writeln!(stdout, "{}b = {}", termion::style::Reset, blue).unwrap();
    }
    
    fn main() {
        let stdin = stdin();
        let mut stdout = stdout().into_raw_mode().unwrap();
    
        writeln!(stdout, "{}{}{}Use the arrow keys to change the blue in the rainbow.",
               termion::clear::All,
               termion::cursor::Goto(1, 1),
               termion::cursor::Hide).unwrap();
    
        let mut blue = 172u8;
    
        for c in stdin.keys() {
            match c.unwrap() {
                Key::Up => {
                    blue = blue.saturating_add(4);
                    rainbow(&mut stdout, blue);
                },
                Key::Down => {
                    blue = blue.saturating_sub(4);
                    rainbow(&mut stdout, blue);
                },
                Key::Char('q') => break,
                _ => {},
            }
            stdout.flush().unwrap();
        }
    
        write!(stdout, "{}", termion::cursor::Show).unwrap();
    }
    
    Open source →
    Release notes

    Termion 1.0.0 is out! This release is breaking, which is also the reason for the semver bump.

    Highlights

    Lot'ta goodies.

    • Mouse support: If you enabled mouse mode through the MouseTerminal struct, you can get mouse events (thanks to IGI-111).

    • TrueColor support: You can now use true color, by the Rgb struct.

    • A complete revision of the way escapes are handled: Everything is now done through Display instead of custom traits.

    • isatty wrapper: termion::is_tty takes any T: AsRawFd and gives you a bool .

    • Crates.io release: Previously, it was distributed solely through git. This turns out to be very convinient, but quite critical whenever making breaking changes (that is, major semver bumps).

    0.1.0 to 1.0.0 guide

    This sample table gives an idea of how to go bu converting to the new major version of Termion.

    0.1.0 1.0.0

    use termion::IntoRawMode use termion::raw::IntoRawMode

    stdout.color(color::Red); write!(stdout, "{}", color::Fg(color::Red));

    stdout.color_bg(color::Red); write!(stdout, "{}", color::Bg(color::Red));

    stdout.goto(x, y); write!(stdout, "{}", cursor::Goto(x, y));

    color::rgb(r, g, b); color::Rgb(r, g, b) (truecolor)

    x.with_mouse() MouseTerminal::from(x)

    An example

    #! [ feature ( step_by ) ] extern crate termion ; use termion :: event :: Key ; use termion :: input :: TermRead ; use termion :: raw :: IntoRawMode ; use std :: io :: { Write , stdout , stdin } ; fn rainbow < W : Write > ( stdout : & mut W , blue : u8 ) { write ! ( stdout , "{}{}" , termion :: cursor :: Goto ( 1 , 1 ) , termion :: clear :: All ) . unwrap ( ) ; for red in ( 0 .. 255 ) . step_by ( 8 as u8 ) { for green in ( 0 .. 255 ) . step_by ( 4 ) { write ! ( stdout , "{} " , termion :: color :: Bg ( termion :: color :: Rgb ( red , green , blue ) ) ) . unwrap ( ) ; } write ! ( stdout , " \n \r " ) . unwrap ( ) ; } writeln ! ( stdout , "{}b = {}" , termion :: style :: Reset , blue ) . unwrap ( ) ; } fn main ( ) { let stdin = stdin ( ) ; let mut stdout = stdout ( ) . into_raw_mode ( ) . unwrap ( ) ; writeln ! ( stdout , "{}{}{}Use the arrow keys to change the blue in the rainbow." , termion :: clear :: All , termion :: cursor :: Goto ( 1 , 1 ) , termion :: cursor :: Hide ) . unwrap ( ) ; let mut blue = 172u8 ; for c in stdin . keys ( ) { match c . unwrap ( ) { Key :: Up => { blue = blue . saturating_add ( 4 ) ; rainbow ( & mut stdout , blue ) ; } , Key :: Down => { blue = blue . saturating_sub ( 4 ) ; rainbow ( & mut stdout , blue ) ; } , Key :: Char ( 'q' ) => break , _ => { } , } stdout . flush ( ) . unwrap ( ) ; } write ! ( stdout , "{}" , termion :: cursor :: Show ) . unwrap ( ) ; }

    You can’t perform that action at this time.

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive