Skip to main content

HTS

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!
Standard

HTS (Character Tabulation Set / Horizontal Tab Set) is a C1 control function that sets a tab stop at the current cursor column.

Syntax​

ESC H         HTS — Set tab stop (7-bit)
0x88 HTS — Set tab stop (8-bit C1)
Formal syntax
HTS = ( 0x1b, "H" ) | 0x88 ;

Description​

Per ECMA-48 §8.3.62, HTS "causes a character tabulation stop to be set at the active presentation position in the presentation component."

After issuing HTS, the current column becomes a tab stop. Subsequent HT (0x09) characters will advance the cursor to this column when the cursor is to its left.

Tab stops persist until explicitly cleared with TBC or until the terminal is reset. The default tab stops (every 8 columns) can be replaced by first clearing all stops with CSI 3 g (TBC) and then setting new ones with HTS at each desired position.

note

In 7-bit environments, HTS is sent as ESC H. Be careful not to confuse this with CSI H (CUP — Cursor Position), which moves the cursor to a specific row and column. The difference is the presence or absence of [ after ESC.

Examples​

# Set custom tab stops at columns 5, 15, and 30
printf '\e[3g' # Clear all tab stops
printf '\e[5G\eH' # Move to column 5, set tab stop
printf '\e[15G\eH' # Move to column 15, set tab stop
printf '\e[30G\eH' # Move to column 30, set tab stop

Specifications​

SpecificationSection
ECMA-48§8.3.62

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓YesESC H listed as IMPLEMENTED in docs/escape_support.md; handler set_horizontal_tabstop() at term/mod.rs:1479
Bobcat✓0.9.0Tab stop control, handled in TerminalCtrl library
contour✓v0.1.0ESC H implemented in processSequence; calls horizontalTabSet()
foot✓YesImplemented in vt.c:509-510 as ESC H, tab_set() at vt.c:444-462
Ghostty✓v1.0.0ESC H handled in stream.zig:2192-2198
iTerm2✓Yes
Kitty✓Yes
Konsole✓Yes
mintty✓YesHandled in do_esc() at src/termout.c:1982-1983
mlterm✓rel-0_2_1
PuTTY✓0.45
Rio✓v0.0.28
rxvt-unicode✓rxvt-unicode-1.2
st✓0.4
terminology✓v1.0.0Accepted but not functional before v1.0.0
VT100✓Yes
VTE✓Yes
WezTerm✓YesHandled in performer.rs:448 via ControlCode::HTS and esc.rs:37 as EscCode::HorizontalTabSet
Windows Terminal✓YesESC H dispatches HorizontalTabSet() in OutputStateMachineEngine.cpp:226-227
xterm✓YesImplemented in charproc.c:5449 via TabSet()
xterm.js✓3.5.0
Multiplexers
cy✓v0.1.0
GNU Screen✓v.4.2.0HTS (ESC H) implemented in DoESC() at src/ansi.c:721
tmux✓1.3Set tab stop at current column
tuios✓v0.0.15
Zellij✓v0.7.0

See also​