which-terminal 0.1.0

Cross-platform terminal detection library for Rust
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 19.27 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.34 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • ahaoboy/which-terminal
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ahaoboy

which-terminal

A cross-platform Rust library for detecting the current terminal emulator and its version.

Crates.io Documentation License: MIT

Features

  • 🚀 Fast detection - Environment-based detection with minimal overhead
  • 🌍 Cross-platform - Supports Windows, macOS, Linux, and Android
  • 📦 Zero dependencies - No external dependencies for core functionality
  • 🔍 20+ terminals - Detects popular terminal emulators across all platforms
  • 📝 Version info - Retrieves version information when available
  • 🦀 Pure Rust - Written entirely in Rust with idiomatic APIs

Supported Terminals

Windows

  • Windows Terminal
  • Command Prompt (cmd.exe)
  • PowerShell
  • ConEmu
  • Cmder

macOS

  • Terminal.app (Apple Terminal)
  • iTerm2

Linux

  • GNOME Terminal
  • Konsole
  • XTerm
  • Rxvt
  • Terminator
  • Tilix

Cross-platform

  • Alacritty
  • Kitty
  • Hyper
  • WezTerm
  • Tabby

Android

  • Termux

Installation

Add this to your Cargo.toml:

[dependencies]
which-terminal = "0.1"

Quick Start

fn main() {
    println!("{:#?}", which_terminal::which_terminal());
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Adding New Terminals

To add support for a new terminal:

  1. Add the terminal variant to the Terminal enum in src/types.rs
  2. Add detection logic to the appropriate platform module
  3. Add version extraction if available
  4. Update documentation and tests

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Inspired by various terminal detection libraries in other languages
  • Thanks to all terminal emulator developers for providing detection mechanisms

Related Projects

  • term - Terminal formatting library
  • console - Terminal and console abstraction
  • crossterm - Cross-platform terminal manipulation