https://github.com/canop/xterm-query
utility to query the terminal
https://github.com/canop/xterm-query
Last synced: about 1 year ago
JSON representation
utility to query the terminal
- Host: GitHub
- URL: https://github.com/canop/xterm-query
- Owner: Canop
- License: mit
- Created: 2022-01-03T21:12:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-21T15:02:14.000Z (over 1 year ago)
- Last Synced: 2025-05-11T07:05:29.335Z (about 1 year ago)
- Language: Rust
- Size: 26.4 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![MIT][s2]][l2] [![Latest Version][s1]][l1] [![docs][s3]][l3] [![Chat on Miaou][s4]][l4]
[s1]: https://img.shields.io/crates/v/xterm-query.svg
[l1]: https://crates.io/crates/xterm-query
[s2]: https://img.shields.io/badge/license-MIT-blue.svg
[l2]: LICENSE
[s3]: https://docs.rs/xterm-query/badge.svg
[l3]: https://docs.rs/xterm-query/
[s4]: https://miaou.dystroy.org/static/shields/room.svg
[l4]: https://miaou.dystroy.org/3
Low level library to query the terminal with a CSI sequence and get the result as a string.
Notes:
- the terminal must already be in raw mode
- there's no Windows support (it should be possible with [WSAPoll](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsapoll) but I don't have any Windows computer to test so a PR would be welcome)
The provided example in examples/kitty demonstrates querying the terminal to know whether the [Kitty graphics protocol](https://sw.kovidgoyal.net/kitty/graphics-protocol/) is supported, and manages entering and leaving raw mode.
If you think you might use this crate but are unsure, don't hesitate to come to Miaou: [![s4]][s4]