csi

package
v0.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package csi provides CSI (Control Sequence Introducer) query functions for terminal capabilities

Index

Constants

View Source
const QueryTimeout = 100 * time.Millisecond

QueryTimeout is the default timeout for CSI queries

Variables

This section is empty.

Functions

func QueryCharacterCellSizeInPixels

func QueryCharacterCellSizeInPixels() (width, height int, ok bool)

QueryCharacterCellSizeInPixels queries character cell size in pixels using CSI 16t returns: width and height in pixels per character, or 0,0,false if query fails

func QueryFontSize

func QueryFontSize() (fontWidth, fontHeight int, ok bool)

QueryFontSize queries the font size from pixel and character dimensions This is useful when combining CSI 14t and CSI 18t results

func QuerySupported

func QuerySupported() bool

QuerySupported checks if a terminal likely supports CSI queries This is a heuristic based on terminal type and environment

func QueryTextAreaSizeInPixels

func QueryTextAreaSizeInPixels() (width, height int, ok bool)

QueryTextAreaSizeInPixels queries text area size in pixels using CSI 14t returns: width and height in pixels, or 0,0 if query fails

func QueryWindowSize

func QueryWindowSize() (cols, rows int, err error)

QueryWindowSize queries the terminal for its current window size

func QueryXTSMGRAPHICS

func QueryXTSMGRAPHICS() (width, height int, ok bool)

QueryXTSMGRAPHICS queries Sixel graphics geometry using XTSMGRAPHICS (xterm 344+) returns: width and height in pixels, and success status

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL