Skip to main content

Cell size

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Experimental

Cell Size is an XTerm window manipulation sequence that queries the pixel dimensions of an individual character cell in the terminal.

Syntax​

CSI 16 t                       Request cell size in pixels
CSI 6 ; height ; width t Response: cell pixel dimensions
Formal syntax
(* Request *)
cell_size_request  = 0x1b, "[", "1", "6", "t" ;

(* Response *)
cell_size_response = 0x1b, "[", "6", ";", Pn, ";", Pn, "t" ;
Pn                 = digit, { digit } ;
digit              = "0" | "1" | "2" | "3" | "4"
                 | "5" | "6" | "7" | "8" | "9" ;

Response​

FieldDescription
heightHeight of a single character cell in pixels
widthWidth of a single character cell in pixels

Description​

This sequence queries the terminal for the pixel dimensions of a single character cell. It is part of the XTerm CSI Ps ; Ps ; Ps t window manipulation family.

When the terminal receives CSI 16 t, it responds with CSI 6 ; height ; width t where height and width are the pixel dimensions of a single character cell. The cell size is determined by the current font and its rendering configuration.

Typical cell sizes for common monospace fonts are in the range of 7-10 pixels wide by 14-20 pixels tall, though high-DPI displays and font scaling can produce larger values.

The cell size report is particularly useful for:

  • Graphics protocols: Applications that render inline graphics (such as Sixel or Kitty Graphics) need the cell size to correctly scale images to align with the character grid.
  • Size calculations: Dividing the Text Area Size (pixels) by the cell size yields the text area dimensions in characters.
  • Mouse position mapping: Converting pixel-based mouse coordinates to character cell positions.

Examples​

# Query cell size
printf '\e[16t'

# Read the response
printf '\e[16t'; read -st 1 -d t response; echo "$response"

Specifications​

SpecificationSection
XTerm ctlseqs—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✗NoExplicitly rejected - CSI 16 t not in supported list (escape_support.md line 81-82)
Bobcat✓0.9.0Requires WindowReports enabled in profile
contour✓v0.1.0
foot✓YesImplemented at csi.c:1347-1354, reports cell height and width in pixels
Ghostty✓v1.0.0
iTerm2✗NoNot implemented. Parser explicitly marks Ps=16 as VT100_NOTSUPPORT. Delegate method terminalCellSizeInPoints exists but is not connected to this sequence.
Kitty✓YesReports cell size in pixels via CSI 6;height;width t
Konsole✓YesReports cell size in pixels via CSI 6 t response
mintty✓YesReports cell dimensions via CSI 16 t, implemented in src/termout.c:3045
mlterm✓rel-3_8_6
PuTTY✗NoNot implemented; CSI t handler only includes cases 1-21 (excluding 10,12,15,16,17)
Rio✓v0.1.11
rxvt-unicode✗NoNot implemented; fwidth/fheight available internally but no CSI 16 t handler
st✗No
terminology✗No
VT100✗No
VTE✗NoCSI 16 t not implemented; VTE skips from operation 14 to 18 in XTERM_WM enum
WezTerm✓YesFully implemented in term/src/terminalstate/mod.rs:2035-2045
Windows Terminal✓YesImplemented as ReportCharacterCellSize in WindowManipulationType enum (value 16)
xterm✓xterm-406Requires OPT_MAXIMIZE compile flag (enabled by default)
xterm.js✓4.4.0Requires windowOptions.getCellSizePixels to be enabled
Multiplexers
cy✗NoCSI t (XTWINOPS) explicitly ignored since v0.1.0
GNU Screen✗NoCSI 16 t not implemented; only CSI 7/8/11/18/21 t are handled
tmux✓3.4Reports cell size in pixels via w->xpixel and w->ypixel
tuios✓v0.2.2
Zellij✓v0.28.0

See also​