Skip to main content

Resize (pixels)

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

Resize (pixels) is an XTerm window manipulation sequence that resizes the terminal window's text area to the specified pixel dimensions.

Syntax​

CSI 4 ; height ; width t     Resize text area to pixel dimensions
Formal syntax
resize_pixels = 0x1b, "[", "4", ";", Pn, ";", Pn, "t" ;
Pn            = digit, { digit } ;
digit         = "0" | "1" | "2" | "3" | "4"
            | "5" | "6" | "7" | "8" | "9" ;

Parameters​

ParameterDescriptionDefault
heightHeight of the text area in pixels(unchanged)
widthWidth of the text area in pixels(unchanged)

Description​

This sequence resizes the terminal window so that the text area (the region where characters are rendered, excluding window decorations such as title bars, scroll bars, and borders) occupies the specified pixel dimensions. It is part of the XTerm CSI Ps ; Ps ; Ps t window manipulation family.

The total window size will be larger than the specified dimensions due to window decorations and padding. If a parameter is omitted or zero, that dimension should remain unchanged, though behavior varies between implementations.

The resulting character grid size depends on the current cell dimensions. For example, resizing to 800x600 pixels with a cell size of 8x16 pixels would yield a 100-column by 37-row grid (with some remainder pixels as padding).

The Text Area Size (pixels) report (CSI 14 t) can be used to query the current text area size in pixels after resizing.

note

Some terminal emulators disable this sequence by default for security reasons. Check your terminal's configuration for options to enable or disable window manipulation sequences.

Examples​

# Resize text area to 800x600 pixels
printf '\e[4;600;800t'

# Resize text area to 1024x768 pixels
printf '\e[4;768;1024t'

Specifications​

SpecificationSection
XTerm ctlseqs—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✗NoRejected per escape_support.md:81-82
Bobcat✓0.9.0Handled via WhenWindowGeometryChange callback; requires WindowActions enabled in profile
contour✓v0.1.0CSI 4;h;w t implemented in WINDOWMANIP (case 4)
foot✗NoCSI 4 t logs unimplemented warning
Ghostty✗NoCSI 4;h;w t not implemented
iTerm2✓v20260216-nightlyCSI 4;h;w t via XTERMCC_WINDOWSIZE_PIXEL
Kitty✗NoCSI 4 t explicitly rejected
Konsole✗NoCSI 4 t not implemented
mintty✓YesCSI 4;h;w t implemented
mlterm✓rel-3_8_0CSI 4 t supported
PuTTY✗NoCSI 4 t recognized but not implemented (terminal.c:4877-4882: 'resizing code isn't healthy enough')
Rio✗No
rxvt-unicode✓1.2
st✗NoNo CSI t window manipulation sequences implemented
terminology✗No
VT100✗No
VTE✓YesConverts pixels to cells and emits resize-window signal
WezTerm✗NoParsed but not allowed for security
Windows Terminal✗NoCSI 4;h;w t not in WindowManipulationType enum
xterm✓xterm-93
xterm.js✓4.4.0CSI 4;h;w t. Requires windowOptions.setWinSizePixels enabled.
Multiplexers
cy✗NoExplicitly ignored
GNU Screen✗NoCSI 4;h;w t not implemented
tmux✗NoSequence parsed but ignored (case 4 in winops)
tuios✗NoCSI 4 t not handled
Zellij✗No

See also​