#[non_exhaustive]pub enum TerminalKind {
Show 26 variants
Alacritty,
AppleTerminal,
Cmder,
ConEmu,
Foot,
Ghostty,
GnomeTerminal,
Hyper,
ITerm2,
JetBrains,
Kitty,
Konsole,
Mintty,
Rio,
Rxvt,
Screen,
St,
Terminator,
Tilix,
Vte,
VSCode,
Warp,
WezTerm,
WindowsTerminal,
Xterm,
Unknown,
}Expand description
A terminal application or emulation family inferred from available hints.
A variant does not always identify the application hosting the session. For example, Xterm
can mean only that TERM names an xterm-compatible emulation. Inspect
TerminalInfo::detected_via to distinguish a program marker from a terminfo fallback.
See Detection logic for precedence and each variant for its markers.
See Edge cases and likely mismatches before treating a
result as the current application’s identity.
Listed TERM families match the exact name or a suffix beginning with - or ..
Program names and terminfo names are matched case-insensitively; presence markers must be
nonempty.
Unknown means no supported hint matched; raw values remain in
TerminalInfo. fmt::Display returns a user-facing name, not a capability guarantee.
The enum is non-exhaustive, so matches need a fallback for other and future variants.
§Example
use detect_terminal::{TerminalKind, detect};
match detect().kind {
TerminalKind::Ghostty => println!("Ghostty hint found"),
TerminalKind::Unknown => println!("No recognized terminal hint"),
other => println!("Other application or emulation: {other}"),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Alacritty
Alacritty terminal emulator. https://alacritty.org
Markers: ALACRITTY_SOCKET, TERM=alacritty.
If Alacritty falls back to TERM=xterm-256color and has no socket marker, this variant
cannot be selected from those hints alone.
AppleTerminal
Terminal.app on macOS. https://support.apple.com/guide/terminal/welcome/mac
Markers: TERM_PROGRAM=Apple_Terminal.
Cmder
Cmder terminal emulator. https://cmder.app
Markers: CMDER_ROOT.
An inherited CMDER_ROOT can outlive the Cmder window that originally set it.
ConEmu
ConEmu terminal emulator. https://conemu.github.io
Markers: ConEmuPID, ConEmuHWND.
Foot
foot terminal emulator. https://codeberg.org/dnkl/foot
Markers: TERM=foot.
A build without foot terminfo can use TERM=xterm-256color and will not select this kind
from TERM alone.
Ghostty
Ghostty terminal emulator. https://ghostty.org
Markers: TERM_PROGRAM=ghostty, TERM=xterm-ghostty,
TERM=ghostty.
GnomeTerminal
GNOME Terminal. https://wiki.gnome.org/Apps/Terminal
Markers: GNOME_TERMINAL_SERVICE, GNOME_TERMINAL_SCREEN.
Hyper
Hyper terminal emulator. https://hyper.is
Markers: TERM_PROGRAM=Hyper.
ITerm2
iTerm2 terminal emulator. https://iterm2.com
Markers: TERM_PROGRAM=iTerm.app. TERM_PROGRAM_VERSION supplies optional version
metadata.
JetBrains
JetBrains IDE terminal. https://www.jetbrains.com/help/idea/terminal-emulator.html
Markers: TERMINAL_EMULATOR containing jetbrains.
Kitty
Kitty terminal emulator. https://sw.kovidgoyal.net/kitty/
Markers: KITTY_WINDOW_ID, KITTY_PID, TERM=xterm-kitty.
Konsole
Konsole terminal emulator. https://konsole.kde.org
Markers: KONSOLE_VERSION.
Mintty
mintty terminal emulator. https://mintty.github.io
Markers: TERM_PROGRAM=mintty.
Rio
Rio terminal emulator. https://rioterm.com
Markers: TERM_PROGRAM=rio, TERM=rio.
Rxvt
rxvt-unicode terminal emulator. https://software.schmorp.de/pkg/rxvt-unicode.html
Markers: RXVT_SOCKET, RXVT_TERM, TERM=rxvt.
Screen
GNU Screen terminal emulation. https://www.gnu.org/software/screen/
Markers: TERM=screen (mux marker STY only affects multiplexer detection).
St
Simple terminal (st). https://st.suckless.org
Markers: TERM=st.
Terminator
Terminator terminal emulator. https://gnome-terminator.org
Markers: TERMINATOR_UUID.
Tilix
Tilix terminal emulator. https://gnunn1.github.io/tilix-web/
Markers: TILIX_ID.
Tilix copies many parent variables. A retained higher-priority marker can mask TILIX_ID.
Vte
VTE-based terminal emulator. https://wiki.gnome.org/Apps/Terminal/VTE
Markers: VTE_VERSION.
This names the VTE emulation family, not a particular application using VTE.
VSCode
Visual Studio Code terminal. https://code.visualstudio.com/docs/terminal/basics
Markers: TERM_PROGRAM=vscode.
Warp
Warp terminal emulator. https://www.warp.dev
Markers: TERM_PROGRAM=WarpTerminal.
WezTerm
WezTerm terminal emulator. https://wezfurlong.org/wezterm/
Markers: TERM_PROGRAM=WezTerm, WEZTERM_EXECUTABLE, WEZTERM_PANE.
WindowsTerminal
Windows Terminal. https://aka.ms/terminal
Markers: WT_SESSION, TERM_PROGRAM=Windows_Terminal or WindowsTerminal.
WT_SESSION can be absent when Windows Terminal attaches as the default console host
after the shell has started. The TERM_PROGRAM values are recognized when supplied, but
Windows Terminal does not inject them in its normal connection path.
Xterm
xterm terminal emulator. https://invisible-island.net/xterm/
Markers: XTERM_VERSION, TERM=xterm.
A TERM=xterm* match identifies an emulation family; Alacritty, foot, and other
applications can use xterm-256color.
Unknown
Unknown or unsupported terminal.