TBC — Tab Clear (CSI g)
Clear one or all tab stops, changing where HT and CBT land.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1b[g (clear current) \x1b[3g (clear all)\033[g / \033[3g\e[g / \e[3gESC [ Ps g1b 5b <Ps> 67Description
Tabulation Clear. Final byte `g` (0x67); the parameter selects scope: `0` (default, also when omitted) = clear the tab stop AT the current column, `3` = clear ALL tab stops. Pair with HTS (`\x1bH`, ESC H) which SETS a tab stop at the current column. Default tab stops sit every 8 columns; once you `\x1b[3g` them all, HT (`\t`) does nothing until you set new ones. This matters for tabular CLI output (`column`, `pr`, `expand`), forms-style TUIs, and any app emitting `\t` for layout — clear the default 8-column grid, then place HTS stops at the actual field boundaries.
Spec citation: ECMA-48 §8.3.154 (TBC)
Parameters
| 0 | clear tab stop at current column |
| 3 | clear ALL tab stops |
Examples
printf '\033[3g' # clear all tab stops\nprintf '\033H' # set a tab stop here (HTS, ESC H)import sys; sys.stdout.write('\x1b[3g')fmt.Print("\x1b[3g")process.stdout.write('\x1b[3g')printf("\x1b[3g");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