Socket
Book a DemoInstallSign in
Socket

supports-terminal-graphics

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supports-terminal-graphics

Detect which terminal graphics protocols are supported (Kitty, iTerm2, Sixel)

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

supports-terminal-graphics

Detect which terminal graphics protocols are supported (Kitty, iTerm2, Sixel)

Detects support for terminal graphics protocols using environment variables. This allows apps to choose the best available protocol for displaying images in the terminal.

Protocols

ProtocolQualityDescription
KittyBestTruecolor RGBA, transparency, animation support
iTerm2GoodFull color, native macOS rendering
SixelBasicPalette-based, widely supported legacy protocol

Install

npm install supports-terminal-graphics

Usage

import supportsTerminalGraphics from 'supports-terminal-graphics';

if (supportsTerminalGraphics.stdout.kitty) {
	// Use Kitty graphics protocol (best quality)
} else if (supportsTerminalGraphics.stdout.iterm2) {
	// Use iTerm2 inline images protocol
} else if (supportsTerminalGraphics.stdout.sixel) {
	// Use Sixel protocol
} else {
	// Fall back to ANSI block characters
}

You can also check stderr:

if (supportsTerminalGraphics.stderr.kitty) {
	// Use Kitty graphics protocol on stderr
}

API

supportsTerminalGraphics

Returns an object with stdout and stderr properties, each containing:

  • kitty - boolean - Whether Kitty graphics protocol is supported
  • iterm2 - boolean - Whether iTerm2 inline images protocol is supported
  • sixel - boolean - Whether Sixel protocol is supported

createSupportsTerminalGraphics(stream?)

Create a custom check for a specific stream.

import {createSupportsTerminalGraphics} from 'supports-terminal-graphics';

const support = createSupportsTerminalGraphics(process.stdout);

console.log(support.kitty);  // true or false
console.log(support.iterm2); // true or false
console.log(support.sixel);  // true or false

Terminal Support

TerminalKittyiTerm2Sixel
Kitty
Ghostty
WezTerm
iTerm2 (v3.6+)
iTerm2 (v2.9.20150512+)
Konsole (22.04+)
VS Code (v1.80+)
Rio
Warp
mintty
mlterm

Keywords

terminal

FAQs

Package last updated on 04 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts