Skip to content

Commit

Permalink
Document variable timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Jan 17, 2024
1 parent e28ccb3 commit b426503
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@
//! ```
//!
//! ## Variable Timeout
//! TODO
//! Knowing whether or not a terminal supports querying for
//! foreground and background colors is a tricky business because terminals are
//! hard to distinguish [^1]. Employing a fixed timeout is not the best options because
//! the terminal might support the sequence but have a lot of latency (e.g. the user is connected over SSH).
//!
//! This library assumes that [terminals support][terminal-survey] the `CSI c` sequence.
//! Using this, it measures the latency. This measurement then informs the timeout enforced on the actual query.
//!
//!
//! [^1]: Many terminals claim that they are `xterm` by setting `TERM=xterm` or `TERM=xterm-256color`, which makes this even harder.
//!
//! ## Comparison with Other Libraries
//! * termbg: TODO
//! * dark-light: TODO
//!
//! [terminal-survey]: https://github.com/bash/term-color/blob/main/doc/terminal-survey.md
use std::io;
use std::time::Duration;
Expand Down

0 comments on commit b426503

Please sign in to comment.