Detect whether the current terminal supports rendering hyperlinks

Related tags

supports-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!

Issues
  • 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 0
  • 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 0
Releases(v1.1.0)
Owner
Kat Marchán
rustacean 🦀, @NuGet team 🍫. Formerly @npmjs 😩
Kat Marchán
Msgpack serialization/deserialization library for Python, written in Rust using PyO3, and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Aviram Hassan 43 Aug 31, 2021
Tiny, no-nonsense, self-contained, Tensorflow and ONNX inference

Sonos' Neural Network inference engine. This project used to be called tfdeploy, or Tensorflow-deploy-rust. What ? tract is a Neural Network inference

Sonos, Inc. 1.1k Sep 17, 2021
Cleora AI is a general-purpose model for efficient, scalable learning of stable and inductive entity embeddings for heterogeneous relational data.

Cleora Cleora is a genus of moths in the family Geometridae. Their scientific name derives from the Ancient Greek geo γῆ or γαῖα "the earth", and metr

Synerise 340 Sep 13, 2021
Machine Learning library for Rust

rusty-machine This library is no longer actively maintained. The crate is currently on version 0.5.4. Read the API Documentation to learn more. And he

James Lucas 1.2k Aug 25, 2021
Machine Learning Library for Rust

autograph Machine Learning Library for Rust undergoing maintenance Features Portable accelerated compute Run SPIR-V shaders on GPU's that support Vulk

null 123 Aug 28, 2021
Xaynet represents an agnostic Federated Machine Learning framework to build privacy-preserving AI applications.

xaynet Xaynet: Train on the Edge with Federated Learning Want a framework that supports federated learning on the edge, in desktop browsers, integrate

XayNet 149 Sep 12, 2021
Wrapper around Microsoft CNTK library

Bindings for CNTK library Simple low level bindings for CNTK library from Microsoft. API Documentation Status Currently exploring ways how to interact

Vlado Boza 20 Aug 30, 2020
A Machine Learning Framework for High Performance written in Rust

polarlight polarlight is a machine learning framework for high performance written in Rust. Key Features TBA Quick Start TBA How To Contribute Contrib

Chris Ohk 15 Aug 16, 2021
A Rust machine learning framework.

Linfa linfa (Italian) / sap (English): The vital circulating fluid of a plant. linfa aims to provide a comprehensive toolkit to build Machine Learning

Rust-ML 1.2k Sep 13, 2021
Efficient ML solutions for long-tailed demands.

MegFlow MegFlow 是一个面向视觉应用的流式计算框架, 目标是简单、高性能、帮助机器学习应用快速落地。 Features 基于 async-std[features=tokio1] 的高效异步运行时调度器 简洁的基于 toml 的建图描述格式 支持静态、动态、共享子图 支持 Rust/P

旷视天元 MegEngine 49 Sep 12, 2021
RustFFT is a high-performance FFT library written in pure Rust.

RustFFT is a high-performance FFT library written in pure Rust. It can compute FFTs of any size, including prime-number sizes, in O(nlogn) time.

Elliott Mahler 254 Aug 31, 2021
Qdrant - vector similarity search engine with extended filtering support

Vector Similarity Search Engine with extended filtering support Qdrant (read: quadrant ) is a vector similarity search engine. It provides a productio

qdrant 560 Sep 12, 2021
Distributed compute platform implemented in Rust, and powered by Apache Arrow.

Ballista: Distributed Compute Platform Overview Ballista is a distributed compute platform primarily implemented in Rust, powered by Apache Arrow. It

Ballista 2.3k Sep 16, 2021
Rust implementation of real-coded GA for solving optimization problems and training of neural networks

revonet Rust implementation of real-coded genetic algorithm for solving optimization problems and training of neural networks. The latter is also know

Yury Tsoy 17 Jun 28, 2021
🦀 Example of serving deep learning models in Rust with batched prediction

rust-dl-webserver This project provides an example of serving a deep learning model with batched prediction using Rust. In particular it runs a GPT2 m

Evan Pete Walsh 21 Sep 16, 2021
Rust bindings for the C++ api of PyTorch.

tch-rs Rust bindings for the C++ api of PyTorch. The goal of the tch crate is to provide some thin wrappers around the C++ PyTorch api (a.k.a. libtorc

Laurent Mazare 1.2k Sep 19, 2021
Fwumious Wabbit, fast on-line machine learning toolkit written in Rust

Fwumious Wabbit is a very fast machine learning tool built with Rust inspired by and partially compatible with Vowpal Wabbit (much love! read more abo

Outbrain 100 Aug 22, 2021
A simple neural net implementation.

PROPHET - Neural Network Library Linux Windows Codecov Coveralls Docs Crates.io A simple neural net implementation written in Rust with a focus on cac

Robin Freyler 40 Aug 23, 2021
Compile-time creation of neural networks

Mushin: Compile-time creation of neural networks Mushin is a Japanese term used in martial arts that refers to the state of mind obtained by practice.

Aitor Ruano 193 Aug 27, 2021