{"id":13438664,"url":"https://github.com/crossterm-rs/crossterm","last_synced_at":"2025-05-13T15:04:07.944Z","repository":{"id":39579501,"uuid":"116140523","full_name":"crossterm-rs/crossterm","owner":"crossterm-rs","description":"Cross platform terminal library rust","archived":false,"fork":false,"pushed_at":"2025-04-15T17:55:14.000Z","size":30234,"stargazers_count":3542,"open_issues_count":175,"forks_count":300,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-05T22:41:39.226Z","etag":null,"topics":["color","console","cross-platform","cursor","input","terminal","tui"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crossterm-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-03T13:34:42.000Z","updated_at":"2025-05-05T16:03:33.000Z","dependencies_parsed_at":"2024-02-26T01:49:48.286Z","dependency_job_id":"a85bcf82-482f-4375-9296-593bc134b0cd","html_url":"https://github.com/crossterm-rs/crossterm","commit_stats":{"total_commits":676,"total_committers":177,"mean_commits":"3.8192090395480225","dds":"0.49852071005917165","last_synced_commit":"b056370038416584746fd59f7576ecd218b29f8d"},"previous_names":["timonpost/crossterm"],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossterm-rs%2Fcrossterm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossterm-rs%2Fcrossterm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossterm-rs%2Fcrossterm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crossterm-rs%2Fcrossterm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crossterm-rs","download_url":"https://codeload.github.com/crossterm-rs/crossterm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253968620,"owners_count":21992256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["color","console","cross-platform","cursor","input","terminal","tui"],"created_at":"2024-07-31T03:01:07.351Z","updated_at":"2025-05-13T15:04:07.925Z","avatar_url":"https://github.com/crossterm-rs.png","language":"Rust","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=Z8QK6XU749JB2"],"categories":["Libraries","Rust","HarmonyOS","库 Libraries","库","Rust 🦀"],"sub_categories":["Command-line","Windows Manager","命令行 Command-line","命令行"],"readme":"\u003ch1 align=\"center\"\u003e\u003cimg width=\"440\" src=\"docs/crossterm_full.png\" /\u003e\u003c/h1\u003e\n\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=Z8QK6XU749JB2) ![Travis][s7] [![Latest Version][s1]][l1] [![MIT][s2]][l2] [![docs][s3]][l3] ![Lines of Code][s6] [![Join us on Discord][s5]][l5]\n\n# Cross-platform Terminal Manipulation Library \n\nCrossterm is a pure-rust, terminal manipulation library that makes it possible to write cross-platform text-based interfaces (see [features](#features)). It supports all UNIX and Windows terminals down to Windows 7 (not all terminals are tested,\nsee [Tested Terminals](#tested-terminals) for more info).\n\n## Table of Contents\n\n- [Cross-platform Terminal Manipulation Library](#cross-platform-terminal-manipulation-library)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n    - [Tested Terminals](#tested-terminals)\n  - [Getting Started](#getting-started)\n    - [Feature Flags](#feature-flags)\n    - [Dependency Justification](#dependency-justification)\n    - [Other Resources](#other-resources)\n  - [Used By](#used-by)\n  - [Contributing](#contributing)\n  - [Authors](#authors)\n  - [License](#license)\n\n## Features\n\n- Cross-platform\n- Multi-threaded (send, sync)\n- Detailed documentation\n- Few dependencies\n- Full control over writing and flushing output buffer\n- Is tty\n- Cursor \n    - Move the cursor N times (up, down, left, right)\n    - Move to previous / next line\n    - Move to column\n    - Set/get the cursor position\n    - Store the cursor position and restore to it later\n    - Hide/show the cursor\n    - Enable/disable cursor blinking (not all terminals do support this feature)\n- Styled output \n    - Foreground color (16 base colors)\n    - Background color (16 base colors)\n    - 256 (ANSI) color support (Windows 10 and UNIX only)\n    - RGB color support (Windows 10 and UNIX only)\n    - Text attributes like bold, italic, underscore, crossed, etc\n- Terminal \n    - Clear (all lines, current line, from cursor down and up, until new line)\n    - Scroll up, down\n    - Set/get the terminal size\n    - Exit current process\n    - Alternate screen\n    - Raw screen   \n    - Set terminal title\n    - Enable/disable line wrapping\n- Event \n    - Input Events \n    - Mouse Events (press, release, position, button, drag)\n    - Terminal Resize Events\n    - Advanced modifier (SHIFT | ALT | CTRL) support for both mouse and key events and\n    - futures Stream  (feature 'event-stream')\n    - Poll/read API\n    \n\u003c!--\nWARNING: Do not change following heading title as it's used in the URL by other crates!\n--\u003e\n\n### Tested Terminals\n\n- Console Host\n    - Windows 10 (Pro)\n    - Windows 8.1 (N)\n- Windows Terminal\n    - Windows 10 x86_64 (Enterprise)\n    - Windows 11 arm64 (Enterprise)\n- Ubuntu Desktop Terminal\n    - Ubuntu 23.04 64-bit\n    - Ubuntu 17.10\n    - Pop!_OS ( Ubuntu ) 20.04\n- (Arch, Manjaro) KDE Konsole\n- (Arch, NixOS) Kitty\n- Linux Mint\n- (OpenSuse) Alacritty\n- (Chrome OS) Crostini\n- Apple\n    - macOS Monterey 12.7.1 (Intel-Chip)\n    - macOS Sonama 14.4 (M1 Max, Apple Silicon-Chip)\n\nThis crate supports all UNIX terminals and Windows terminals down to Windows 7; however, not all of the\nterminals have been tested. If you have used this library for a terminal other than the above list without\nissues, then feel free to add it to the above list - I really would appreciate it!\n\n## Getting Started\n_see the [examples directory](examples/) and [documentation](https://docs.rs/crossterm/) for more advanced examples._\n\n\u003cdetails\u003e\n\u003csummary\u003e\nClick to show Cargo.toml.\n\u003c/summary\u003e\n\n```toml\n[dependencies]\ncrossterm = \"0.27\"\n```\n\n\u003c/details\u003e\n\u003cp\u003e\u003c/p\u003e\n\n```rust\nuse std::io::{stdout, Write};\n\nuse crossterm::{\n    execute,\n    style::{Color, Print, ResetColor, SetBackgroundColor, SetForegroundColor},\n    ExecutableCommand,\n    event,\n};\n\nfn main() -\u003e std::io::Result\u003c()\u003e {\n    // using the macro\n    execute!(\n        stdout(),\n        SetForegroundColor(Color::Blue),\n        SetBackgroundColor(Color::Red),\n        Print(\"Styled text here.\"),\n        ResetColor\n    )?;\n\n    // or using functions\n    stdout()\n        .execute(SetForegroundColor(Color::Blue))?\n        .execute(SetBackgroundColor(Color::Red))?\n        .execute(Print(\"Styled text here.\"))?\n        .execute(ResetColor)?;\n    \n    Ok(())\n}\n```\n\nCheckout this [list](https://docs.rs/crossterm/latest/crossterm/index.html#supported-commands) with all possible commands.\n\n### Feature Flags\n\n```toml\n[dependencies.crossterm]\nversion = \"0.27\"\nfeatures = [\"event-stream\"] \n```\n\n| Feature        | Description                                  |\n|:---------------|:---------------------------------------------|\n| `event-stream` | `futures::Stream` producing `Result\u003cEvent\u003e`. |\n| `serde`        | (De)serializing of events.                   |\n| `events`        | Reading input/system events (enabled by default) |\n| `filedescriptor` | Use raw filedescriptor for all events rather then mio dependency |\n| `derive-more`  | Adds `is_*` helper functions for event types |\n| `osc52`        | Enables crossterm::clipboard                 |\n\n\nTo use crossterm as a very thin layer you can disable the `events` feature or use `filedescriptor` feature. \nThis can disable `mio` / `signal-hook` / `signal-hook-mio` dependencies.\n\n### Dependency Justification\n\n| Dependency     | Used for                                                                         | Included                              |\n|:---------------|:---------------------------------------------------------------------------------|:--------------------------------------|\n| `bitflags`     | `KeyModifiers`, those are differ based on input.                                 | always                                |\n| `parking_lot`  | locking `RwLock`s with a timeout, const mutexes.                                 | always                                |\n| `libc`         | UNIX terminal_size/raw modes/set_title and several other low level functionality. | optional (`events` feature), UNIX only |\n| `Mio`          | event readiness polling, waking up poller                                        | optional (`events` feature), UNIX only |\n| `signal-hook`  | signal-hook is used to handle terminal resize SIGNAL with Mio.                   |  optional (`events` feature),UNIX only |\n| `winapi`       | Used for low-level windows system calls which ANSI codes can't replace           | windows only                          |\n| `futures-core` | For async stream of events                                                       | only with `event-stream` feature flag |\n| `serde`        | ***ser***ializing and ***de***serializing of events                              | only with `serde` feature flag        |\n| `derive_more`  | Adds `is_*` helper functions for event types                                     | optional (`derive-more` feature), included by default |\n| `base64`       | Encoding clipboard data for OSC52 sequences in crossterm::clipboard              | only with `osc52` feature flag        |\n\n### Other Resources\n\n- [API documentation](https://docs.rs/crossterm/)\n- [Deprecated examples repository](https://github.com/crossterm-rs/examples)\n\n## Used By\n\n- [Broot](https://dystroy.org/broot/)\n- [Cursive](https://github.com/gyscos/Cursive)\n- [Ratatui](https://github.com/ratatui/ratatui)\n- [Rust-sloth](https://github.com/ecumene/rust-sloth)\n- [Rusty-rain](https://github.com/cowboy8625/rusty-rain)\n\n## Contributing\n  \nWe highly appreciate when anyone contributes to this crate. Before you do, please,\nread the [Contributing](docs/CONTRIBUTING.md) guidelines. \n\n## Authors\n\n* **Timon Post** - *Project Owner \u0026 creator*\n\n## License\n\nThis project, `crossterm` and all its sub-crates: `crossterm_screen`, `crossterm_cursor`, `crossterm_style`,\n`crossterm_input`, `crossterm_terminal`, `crossterm_winapi`, `crossterm_utils` are licensed under the MIT\nLicense - see the [LICENSE](https://github.com/crossterm-rs/crossterm/blob/master/LICENSE) file for details.\n\n[s1]: https://img.shields.io/crates/v/crossterm.svg\n[l1]: https://crates.io/crates/crossterm\n\n[s2]: https://img.shields.io/badge/license-MIT-blue.svg\n[l2]: ./LICENSE\n\n[s3]: https://docs.rs/crossterm/badge.svg\n[l3]: https://docs.rs/crossterm/\n\n[s3]: https://docs.rs/crossterm/badge.svg\n[l3]: https://docs.rs/crossterm/\n\n[s5]: https://img.shields.io/discord/560857607196377088.svg?logo=discord\n[l5]: https://discord.gg/K4nyTDB\n\n[s6]: https://tokei.rs/b1/github/crossterm-rs/crossterm?category=code\n[s7]: https://travis-ci.org/crossterm-rs/crossterm.svg?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrossterm-rs%2Fcrossterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrossterm-rs%2Fcrossterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrossterm-rs%2Fcrossterm/lists"}