#terminal-size #terminal #crossterm #clear #size #console #action

deprecated crossterm_terminal

A cross-platform library for doing terminal related actions

11 releases

0.3.2 Oct 21, 2019
0.3.1 Sep 25, 2019
0.2.6 Aug 2, 2019
0.2.5 Jul 25, 2019
0.1.0 Jan 27, 2019

#17 in #terminal-size

Download history 228/week @ 2023-11-27 165/week @ 2023-12-04 203/week @ 2023-12-11 263/week @ 2023-12-18 168/week @ 2023-12-25 133/week @ 2024-01-01 385/week @ 2024-01-08 318/week @ 2024-01-15 298/week @ 2024-01-22 203/week @ 2024-01-29 243/week @ 2024-02-05 266/week @ 2024-02-12 251/week @ 2024-02-19 387/week @ 2024-02-26 297/week @ 2024-03-04 138/week @ 2024-03-11

1,117 downloads per month

MIT license

31KB
449 lines

Lines of Code Latest Version MIT docs Join us on Discord

Crossterm Terminal

The crossterm_terminal crate is deprecated and no longer maintained. The GitHub repository will be archived soon. All the code is being moved to the crossterm crate. You can learn more in the Merge sub-crates to the crossterm crate issue.

This crate allows you to perform terminal related actions cross-platform e.g clearing, resizing etc. It supports all UNIX and Windows terminals down to Windows 7 (not all terminals are tested, see Tested Terminals for more info).

crossterm_terminal is a sub-crate of the crossterm crate. You can use it directly, but it's highly recommended to use the crossterm crate with the terminal feature enabled.

Features

  • Cross-platform
  • Multi-threaded (send, sync)
  • Detailed Documentation
  • Few Dependencies
  • Terminal
    • Clear (all lines, current line, from cursor down and up, until new line)
    • Scroll up, down
    • Set/get the terminal size
    • Exit current process

Getting Started

Click to show Cargo.toml.
[dependencies]
# All crossterm features are enabled by default.
crossterm = "0.11"

use std::io::{stdout, Write};  
use crossterm::{execute, SetSize, ScrollUp, Result};

fn main() -> Result<()> {
    execute!(stdout(), SetSize(10, 10), ScrollUp(5))
}

Other Resources

Authors

  • Timon Post - Project Owner & creator

License

This project is licensed under the MIT License - see the LICENSE file for details

Dependencies

~0.8–1.3MB
~21K SLoC