Detect whether the current terminal supports rendering hyperlinks

Overview

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!

use supports_hyperlinks::Stream;

if supports_hyperlinks::on(Stream::Stdout) {
    println!("This terminal supports hyperlinks on stdout");
} else {
    println!("No hyperlinks, please");
}

And that's it!

You might also like...
Detect if code is running inside a virtual machine (x86 and x86-64 only).

inside-vm Detect if code is running inside a virtual machine. Only works on x86 and x86-64. How does it work Measure average cpu cycles when calling c

Detect timestamp of all scene changes in video

detect-scene-change detect timestamp of all scene changes in video Usage

Firecracker takes your HTTP logs and uses them to map your API flows and to detect anomalies in them.
Firecracker takes your HTTP logs and uses them to map your API flows and to detect anomalies in them.

Who is BLST and what do we do? BLST (Business Logic Security Testing) is a startup company that's developing an automatic penetration tester, replacin

fast rust implementation of online nonnegative matrix factorization as laid out in the paper "detect and track latent factors with online nonnegative matrix factorization"

ONMF status: early work in progress. still figuring this out. code still somewhat messy. api still in flux. fast rust implementation of online nonnega

Rust library to detect bots using a user-agent string

Rust library to detect bots using a user-agent string

A rust program to try and detect some types of Hardware Keyloggers.
A rust program to try and detect some types of Hardware Keyloggers.

Hardware Keylogger Detection Warning: Certain Types of Hardware keyloggers can not be detected by this program, Passive Hardware Keyloggers are imposs

A rust interval arithmetic library which provides flags that detect domain errors.

intervals-good A Rust interval arithmetic library which provides flags that detect domain errors, supports more functions than any other interval arit

A mini CLI tool to detect secrets & credentials in source code
A mini CLI tool to detect secrets & credentials in source code

Fencer Fencer is a mini-CLI tool that can used to scan various kind of secrets/credentials that are hardcoded into a project source code files Feature

A additional Rust compiler pass to detect memory safe bugs of Rust programs.

SafeDrop A additional Rust compiler pass to detect memory safe bugs of Rust programs. SafeDrop performs path-sensitive and field-sensitive inter-proce

Detect polymer contaminants in mass spectra.
Detect polymer contaminants in mass spectra.

🦨 mzsniffer 👃 Detect polymer contaminants in mass spectra. Introduction Mzsniffer is a command line application to quickly detect common polymer con

Detect EDR's exceptions by inspecting processes' loaded modules
Detect EDR's exceptions by inspecting processes' loaded modules

Description This tool looks for either the processes that have a certain binary loaded or the processes that don't. This is useful in the following sc

A rust crate for rendering large text to the terminal using font8x8 and ratatui.
A rust crate for rendering large text to the terminal using font8x8 and ratatui.

tui-big-text tui-big-text is a rust crate that renders large pixel text as a ratatui widget using the glyphs from the font8x8 crate. Installation carg

rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

🌲 Open the current remote repository in your browser
🌲 Open the current remote repository in your browser

gitweb Some of the flags and options are subject to change in the future. Ideas are welcome. Ideas are bulletproof (V). gitweb is a command line inter

gstats — command line tool to print a developer handy summary of all git repositories below current directory

gstats Simple Rust tool to get quick summary info on git repos showing latest tag, branch, state. I implemented this to help me work with a the not to

A multi-threaded GTK 3 application for fetching the lyrics of the current playing song
A multi-threaded GTK 3 application for fetching the lyrics of the current playing song

Lyriek A multi-threaded GTK 3 application for fetching the lyrics of the current playing song. Installation Arch Linux yay -S lyriek Ubuntu apt insta

rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

A program written in Rust, that allows the user to find the current location of the International Space Station and see it on a map.

ISS Location ViewFinder A program written in Rust, that allows the user to find the current location of the International Space Station and see it on

KERI implementation in RUST, current development lead by DIF

KERIOX Introduction Features Introduction KERIOX is an open source Rust implementation of the Key Event Receipt Infrastructure (KERI) , a system desig

Comments
  • Support env var to force hyperlinks on (or off)

    Support env var to force hyperlinks on (or off)

    There should be a way for me, as a user, to explicitly request hyperlinks (or turn them off). Declaring an env var for this is the obvious choice.

    Requesting would be for if my terminal supports it but the code hasn’t been updated for it, or if the env var normally used to detect it has been modified (e.g. if I use Kitty and ssh to another machine, I have to reset my TERM as xterm-kitty is not in standard terminfo databases, but doing so means my terminal can’t be detected as Kitty anymore).

    Turning it off is for false positives (e.g. my terminal doesn’t support it but has inherited an env var that is used to detect support).

    opened by lilyball 2
  • A negative match on one test should not stop the rest

    A negative match on one test should not stop the rest

    Right now, if one of the env vars tested exists but doesn’t pass the requisite test, it doesn’t check the rest. This can cause false negatives.

    For example, if I launch kitty from Terminal.app. TERM_PROGRAM is set to Apple_Terminal (Kitty doesn’t set this var), but TERM is set to xterm-kitty. This crate will return false though as it checks TERM_PROGRAM first and doesn’t even look at TERM if it’s set.

    More generally, the issue is this crate tests vars that are not guaranteed to be set by the terminal emulator, and therefore might have been inherited. This can cause false positives too, such as if a supporting terminal launches one that doesn’t support it but doesn’t set TERM_PROGRAM, but that’s less of an issue as hyperlinks degrade gracefully.

    opened by lilyball 1
Releases(v1.1.0)
Owner
Kat Marchán
rustacean 🦀, @NuGet team 🍫. Formerly @npmjs 😩
Kat Marchán
General matrix multiplication with custom configuration in Rust. Supports no_std and no_alloc environments.

microgemm General matrix multiplication with custom configuration in Rust. Supports no_std and no_alloc environments. The implementation is based on t

null 4 Nov 6, 2023
An NVIDIA SMI'esk GPU Monitoring tool for your terminal.

NVTOP An NVIDIA SMI'esk GPU Monitoring tool for your terminal. art by stable-diffusion + Maz Contents: usage prerequisites installation why troublesho

Jer 17 Oct 14, 2023
Detects whether a terminal supports unicode.

Detects whether a terminal supports unicode. This crate is a Rust port mashing together @sindresorhus' is-unicode-supported and @iarna's has-unicode N

Kat Marchán 11 Jul 29, 2022
Detects whether a terminal supports color, and gives details about that support

Detects whether a terminal supports color, and gives details about that support. It takes into account the NO_COLOR environment variable. This crate i

Kat Marchán 30 Dec 29, 2022
Test whether a given stream is a terminal

is-terminal Test whether a given stream is a terminal is-terminal is a simple utility that answers one question: Is this a terminal? A "terminal", als

Dan Gohman 19 Dec 31, 2022
Let Tauri's transparent background rendering window be stacked on Bevy's rendering window in real time to run the game with native-level performance!

Native Bevy with Tauri HUD DEMO 将 Tauri 的透明背景渲染窗口实时叠在 Bevy 的渲染窗口上,以使用原生级别性能运行游戏! Let Tauri's transparent background rendering window be stacked on Bev

伊欧 3 Mar 25, 2024
Build frontend browser apps with Rust + WebAssembly. Supports server side rendering.

Percy Build frontend browser apps with Rust + WebAssembly. Supports server side rendering. The Percy Book This README gives a light introduction to Pe

Chinedu Francis Nwafili 2.1k Jan 1, 2023
Convert UFO .glif files to SVG, whether they're part of a font or not

Convert UFO glyph files (.glif) to SVG There exists already an svg2glif, but for some reason not the opposite operation. My MFEKglif editor treats .gl

Modular Font Editor K 3 Apr 26, 2022
A Rust library for evaluating log4j substitution queries in order to determine whether or not malicious queries may exist.

log4j_interpreter A Rust library for evaluating log4j substitution queries in order to determine whether or not malicious queries may exist. Limitatio

Fastly 22 Nov 7, 2022
Checks whether the process is running as root/sudo/admin permission in Windows and Unix systems

Is_sudo Checks if program is running as sudo in unix systems, or using admin permission in windows. Usage use is_sudo::check; use is_sudo::RunningAs;

Spark 2 Aug 12, 2022