1 unstable release
Uses new Rust 2024
| 0.1.0 | Nov 7, 2025 |
|---|
#533 in Command-line interface
20KB
330 lines
which-terminal
A cross-platform Rust library for detecting the current terminal emulator and its version.
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:
- Add the terminal variant to the
Terminalenum insrc/types.rs - Add detection logic to the appropriate platform module
- Add version extraction if available
- 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