#cursor #crossterm #cursor-position #cross-platform #terminal #cli

deprecated crossterm_cursor

A cross-platform library for moving the terminal cursor

11 unstable releases (3 breaking)

0.4.0 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

#13 in #cursor-position

Download history 366/week @ 2024-03-13 379/week @ 2024-03-20 413/week @ 2024-03-27 468/week @ 2024-04-03 365/week @ 2024-04-10 452/week @ 2024-04-17 540/week @ 2024-04-24 381/week @ 2024-05-01 416/week @ 2024-05-08 375/week @ 2024-05-15 317/week @ 2024-05-22 437/week @ 2024-05-29 360/week @ 2024-06-05 423/week @ 2024-06-12 599/week @ 2024-06-19 396/week @ 2024-06-26

1,858 downloads per month
Used in 2 crates (via crossterm_terminal)

MIT license

33KB
583 lines

Lines of Code Latest Version MIT docs Join us on Discord

Crossterm Cursor

The crossterm_cursor 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 work with the terminal cursor. It supports all UNIX and Windows terminals down to Windows 7 (not all terminals are tested, see the Tested Terminals for more info).

crossterm_cursor 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 cursor feature enabled.

Features

  • Cross-platform
  • Multi-threaded (send, sync)
  • Detailed documentation
  • Few dependencies
  • Cursor
    • Move the cursor N times (up, down, left, right)
    • Set/get the cursor position
    • Store the cursor position and restore to it later
    • Hide/show the cursor
    • Enable/disable cursor blinking (not all terminals do support this feature)

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, Goto, Result};

fn main() -> Result<()> {
    execute!(stdout(), Goto(10, 10))
}

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.7–1MB
~16K SLoC