Skip to main content

HT

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

HT (Character Tabulation / Horizontal Tab) is a C0 control character that advances the cursor to the next tab stop.

Syntax​

HT        0x09
Formal syntax
HT = 0x09 ;

Description​

Per ECMA-48 §8.3.60, HT "causes the active presentation position to be moved to the following character tabulation stop in the presentation component."

By default, tab stops are set every 8 columns (columns 1, 9, 17, 25, ...). Tab stops can be modified using HTS (set a tab stop at the current column), TBC (clear tab stops), or the DECST8C sequence.

If there are no more tab stops between the cursor and the right margin, behavior varies by terminal. Most terminals move the cursor to the last column of the line.

HT does not erase characters between the current cursor position and the destination tab stop. The intervening cells are typically filled with spaces in the display, but the cursor simply jumps to the next stop position.

Examples​

printf 'A\tB\tC'     # Print A, B, C separated by tab stops
printf '\e[3g' # Clear all tab stops (TBC)
printf '\eH' # Set a tab stop at the current column (HTS)

Specifications​

SpecificationSection
ECMA-48§8.3.60

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓YesHandler put_tab() at term/mod.rs:1366, respects tab stops
Bobcat✓0.9.0Tab stops referenced in termios config (Terminal.cpp:78-91)
contour✓v0.1.0Implemented in executeControlCode; calls moveCursorToNextTab()
foot✓YesImplemented in vt.c:169-224
Ghostty✓v1.0.0Handled in stream.zig:769 as C0.HT (0x09)
iTerm2✓Yes
Kitty✓Yes
Konsole✓Yes
mintty✓YesHandled in do_ctrl() at src/termout.c:1693
mlterm✓rel-0_2_1
PuTTY✓0.45
Rio✓v0.0.28
rxvt-unicode✓rxvt-unicode-1.2
st✓0.6
terminology✓v0.1.0
VT100✓Yes
VTE✓Yes
WezTerm✓YesHandled in performer.rs:447 via ControlCode::HorizontalTab, calls c0_horizontal_tab()
Windows Terminal✓YesHandled via ForwardTab(1) dispatch in OutputStateMachineEngine.cpp:62-63
xterm✓YesImplemented in charproc.c:3763. Horizontal tab via TabToNextStop()
xterm.js✓2.3.0
Multiplexers
cy✓v0.1.0
GNU Screen✓v.4.2.0Implemented in Special() function at src/ansi.c:694
tmux✓0.8Moves cursor to next tab stop, respects tab array
tuios✓v0.0.15
Zellij✓v0.5.0-beta

See also​