terminal_relaunch

Crates.ioterminal_relaunch
lib.rsterminal_relaunch
version0.2.3
created_at2026-01-07 22:58:55.511713+00
updated_at2026-01-12 05:53:18.534512+00
descriptionA simple small library for relaunching the program in an alternative installed terminal with better feature support
homepage
repositoryhttps://github.com/zephhhhhh/terminal_relaunch
max_upload_size
id2029201
size61,543
Adam (zephhhhhh)

documentation

README

Terminal Relaunch

License: MIT Rust Rust Static Badge

A simple Rust library for detecting terminal capabilities and relaunching programs in better terminals with enhanced feature support, such as RGB ANSI colour and full Unicode rendering support for emojis, etc.

Features

  • Terminal Detection: Automatically identifies the current terminal type (Windows Terminal, CMD, VSCode, etc.)
  • Feature Detection: Checks for RGB/ANSI color support and full Unicode rendering
  • Smart Relaunching: Automatically find an installed and better terminal if available to relaunch your CLI app in.

Installation

Add this to your Cargo.toml:

[dependencies]
terminal_relaunch = "0.2.2"

Quick Start

use terminal_relaunch::{relaunch_if_available_and_exit, CURRENT_TERMINAL};

fn main() {
    // Check if we should attempt to relaunch
    match relaunch_if_available_and_exit() {
        Ok(()) => println!("Terminal features met!"),
        Err(e) => eprintln!("Terminal could not relaunch: {e:?}"),
    }

    // Continue with your application..
    println!("Terminal information: {}", CURRENT_TERMINAL.verbose_format())
}

Usage

Detect Current Terminal

use terminal_relaunch::CURRENT_TERMINAL;

println!("Terminal: {}", CURRENT_TERMINAL.verbose_format());

Check Feature Support

use terminal_relaunch::{SUPPORTS_FULL_UNICODE, SUPPORTS_RGB_ANSI_COLOURS};

if *SUPPORTS_FULL_UNICODE {
    println!("✨ Unicode emojis work!");
}

if *SUPPORTS_RGB_ANSI_COLOURS {
    println!("\x1b[38;2;255;0;0mRGB colors work!\x1b[0m");
}

Currently Supported Terminals

Detection

  • Windows Specific:
    • Windows Terminal
    • CMD/PowerShell
  • MacOS Specific:
    • Terminal.app
    • ITerm2
    • Kitty
    • Ghostty
  • Other terminals:
    • Alacritty
    • WezTerm
  • Editor terminals:
    • VSCode
    • NVIM
  • Generic Linux Terminals

Relaunching

  • Windows Terminal
  • ITerm2 (MacOS)
  • Ghostty (MacOS)
  • Kitty (MacOS)
  • Alacritty
  • WezTerm (MacOS)

License

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

Commit count: 25

cargo fmt