Detect whether the current terminal supports rendering hyperlinks
- Rust 100%
| .github | meta: add FUNDING.yml | |
| src | feat(term_programs): add ghostty as a supported terminal ( #5 ) | |
| .editorconfig | feat(api): initial commit | |
| .gitignore | feat(api): initial commit | |
| Cargo.toml | chore: Release supports-hyperlinks version 3.1.0 | |
| CHANGELOG.md | docs: update changelog | |
| cliff.toml | meta: fix changelog rendering | |
| LICENSE | feat(api): initial commit | |
| Makefile.toml | feat(api): initial commit | |
| README.md | docs: document new msrv | |
Detects whether the current terminal supports hyperlinks in terminal emulators.
It tries to detect and support all known terminals and terminal families that support this. If a declaration is wrong, missing, or could be improved, please send a PR!
Example
The API is super simple!
usesupports_hyperlinks::Stream;ifsupports_hyperlinks::on(Stream::Stdout){println!("This terminal supports hyperlinks on stdout");}else{println!("No hyperlinks, please");}And that's it!
Forcing hyperlinks in tools that use supports-hyperlinks
You may set the FORCE_HYPERLINK environment variable to force
supports-hyperlinks to return true for its checks. If the value is 0, this
will force it to be false, instead.
MSRV
The minimum supported Rust version is 1.70.0.