pub enum TerminalProgram {
Dumb,
Ansi,
ITerm2,
Terminology,
Kitty,
WezTerm,
VSCode,
}Expand description
A terminal application.
Variants§
Dumb
A dumb terminal which does not support any formatting.
Ansi
A plain ANSI terminal which supports only standard ANSI formatting.
ITerm2
iTerm2.
iTerm2 is a powerful macOS terminal emulator with many formatting features, including images and inline links.
See https://www.iterm2.com for more information.
Terminology
Terminology.
See http://terminolo.gy for more information.
Kitty
Kitty.
kitty is a fast, featureful, GPU-based terminal emulator with a lot of extensions to the terminal protocol.
See https://sw.kovidgoyal.net/kitty/ for more information.
WezTerm
WezTerm
WezTerm is a GPU-accelerated cross-platform terminal emulator and multiplexer. It’s highly customizable and supports some terminal extensions.
See https://wezfurlong.org/wezterm/ for more information.
VSCode
The built-in terminal in VSCode.
Since version 1.80 it supports images with the iTerm2 protocol.
Implementations§
source§impl TerminalProgram
impl TerminalProgram
sourcepub fn detect() -> Self
pub fn detect() -> Self
Attempt to detect the terminal program mdcat is running on.
This function looks at various environment variables to identify the terminal program.
It first looks at $TERM to determine the terminal program, then at $TERM_PROGRAM, and
finally at $TERMINOLOGY.
If $TERM is set to anything other than xterm-256colors it’s definitely accurate, since
it points to the terminfo entry to use. $TERM also propagates across most boundaries
(e.g. sudo, ssh), and thus the most reliable place to check.
However, $TERM only works if the terminal has a dedicated entry in terminfo database. Many
terminal programs avoid this complexity (even WezTerm only sets $TERM if explicitly
configured to do so), so mdcat proceeds to look at other variables. However, these are
generally not as reliable as $TERM, because they often do not propagate across SSH or
sudo, and may leak if one terminal program is started from another one.
§Returns
TerminalProgram::Kittyif$TERMisxterm-kitty.TerminalProgram::WezTermif$TERMiswezterm.TerminalProgram::WezTermif$TERM_PROGRAMisWezTerm.TerminalProgram::ITerm2if$TERM_PROGRAMisiTerm.app.TerminalProgram::Terminologyif$TERMINOLOGYis1.TerminalProgram::Ansiotherwise.
sourcepub fn capabilities(self) -> TerminalCapabilities
pub fn capabilities(self) -> TerminalCapabilities
Get the capabilities of this terminal emulator.
Trait Implementations§
source§impl Clone for TerminalProgram
impl Clone for TerminalProgram
source§fn clone(&self) -> TerminalProgram
fn clone(&self) -> TerminalProgram
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TerminalProgram
impl Debug for TerminalProgram
source§impl Display for TerminalProgram
impl Display for TerminalProgram
source§impl PartialEq for TerminalProgram
impl PartialEq for TerminalProgram
source§fn eq(&self, other: &TerminalProgram) -> bool
fn eq(&self, other: &TerminalProgram) -> bool
self and other values to be equal, and is used
by ==.