HTS — Horizontal Tab Set (ESC H)
Set a tab stop at the current cursor column — partner to TBC.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\\x1b[
\x1bH\\033[
\033H\\e[
\eHESC [
ESC Hhex
1b 48Description
Two-byte ESC `H` sequence (no CSI introducer, no parameters). Places a tab stop at whichever column the cursor occupies right now. Pair with TBC (`\x1b[g` / `\x1b[3g`) which clears tab stops. Workflow: `printf '\033[3g'` to wipe the default 8-column grid, move the cursor to each desired column with HPA / CHA (`\x1b[Nd` / `\x1b[NG`) and emit `\x1bH` once per stop. After that, every `\t` (HT, 0x09) or `\x1b[NI` (CHT) advances to your custom layout. The terminfo capability for HTS is `hts`.
Spec citation: ECMA-48 §8.3.62 (HTS)
Examples
printf '\033[3g' # clear all\nprintf '\033[10G\033H\033[20G\033H' # set tab stops at cols 10 and 20import sys; sys.stdout.write('\x1bH')fmt.Print("\x1bH")process.stdout.write('\x1bH')printf("\x1bH");Terminal support
- xterm
- yes
- Linux console (fbcon)
- yes
- macOS Terminal.app
- yes
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- partial
- kitty
- yes
- alacritty
- yes
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- yes
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yes | yes | yes | yes | yes | partial | yes | yes | yes | yes | yes | yes | no | no |
Related sequences
In the family cookbook
ESC cookbook · 2. Tab stops — `\x1bH` (HTS) sets, `\x1b[g` (TBC) clears