{"id":22396932,"url":"https://github.com/atrox/terminal-utils","last_synced_at":"2025-03-26T23:15:39.833Z","repository":{"id":191181105,"uuid":"684178023","full_name":"Atrox/terminal-utils","owner":"Atrox","description":"🦀 A collection of utilities for working with the terminal in rust.","archived":false,"fork":false,"pushed_at":"2024-04-15T06:31:35.000Z","size":11,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T12:05:25.396Z","etag":null,"topics":[],"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/Atrox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-08-28T16:04:13.000Z","updated_at":"2023-08-28T16:05:50.000Z","dependencies_parsed_at":"2024-01-29T22:50:46.651Z","dependency_job_id":null,"html_url":"https://github.com/Atrox/terminal-utils","commit_stats":null,"previous_names":["atrox/terminal-utils"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atrox%2Fterminal-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atrox%2Fterminal-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atrox%2Fterminal-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atrox%2Fterminal-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Atrox","download_url":"https://codeload.github.com/Atrox/terminal-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245749906,"owners_count":20666086,"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":[],"created_at":"2024-12-05T06:09:56.273Z","updated_at":"2025-03-26T23:15:39.811Z","avatar_url":"https://github.com/Atrox.png","language":"Rust","readme":"# terminal-utils\n\n[![Crates.io](https://img.shields.io/crates/v/terminal-utils)](https://crates.io/crates/terminal-utils)\n[![Documentation](https://docs.rs/terminal-utils/badge.svg)](https://docs.rs/terminal-utils)\n[![License](https://img.shields.io/crates/l/terminal-utils)](LICENSE)\n\nThis crate provides utilities for working with terminals.\n\n## Terminal size\n\n```rust\nlet size = terminal_utils::size().unwrap();\nprintln!(\"The terminal is {}x{} characters.\", size.width, size.height);\n```\n\n## Raw mode\n\n```rust\nlet raw_mode_guard = terminal_utils::enable_raw_mode().unwrap();\nprintln!(\"Raw mode is enabled.\");\n\nlet is_raw_mode_enabled = terminal_utils::is_raw_mode_enabled().unwrap();\nassert!(is_raw_mode_enabled);\n\n// Previous terminal mode is restored when the guard is dropped.\ndrop(raw_mode_guard);\nprintln!(\"Raw mode is disabled.\");\n```\n\n## Resize signal\n\nThis feature is only available with the `tokio` feature. It is enabled by default.\n\n```rust\nlet mut resize_rx = terminal_utils::on_resize().unwrap();\ntokio::spawn(async move {\n    loop {\n        resize_rx.changed().await.unwrap();\n\n        let size = resize_rx.borrow();\n        println!(\"terminal size changed: {:?}\", size);\n    }\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatrox%2Fterminal-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatrox%2Fterminal-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatrox%2Fterminal-utils/lists"}