Skip to main content
ansicode

SGR 8 — Conceal / Hidden

Render following text invisibly (cursor still advances).

Byte forms

Every common string-literal form so you can paste-and-search either direction.

\\x1b[\x1b[8m
\\033[\033[8m
\\e[\e[8m
ESC [ESC [ 8 m
hex1b 5b 38 6d

Description

Sets the foreground to be visually identical to the background — the text still occupies cells and is preserved by `select-all`/copy. Useful for spoiler tags or password-style display, but NOT a security primitive: the text is copyable. Disable with `\x1b[28m`. Most modern terminals honor it; Linux console and ConPTY treat it as a no-op.

Spec citation: ECMA-48 §8.3.117 (SGR parameter 8)

Examples

bash
printf 'password: \033[8mhunter2\033[28m (select to reveal)\033[0m\n'
python
print('\x1b[8mhidden\x1b[0m')
go
fmt.Print("\x1b[8mhidden\x1b[0m")
javascript
console.log('\x1b[8mhidden\x1b[0m')
c
printf("\x1b[8mhidden\x1b[0m\n");

Terminal support

xterm
yes
Linux console (fbcon)
no
macOS Terminal.app
yes
iTerm2
yes
Windows Terminal
yes
cmd.exe / ConPTY
no
kitty
yes
alacritty
yes
WezTerm
yes
Ghostty
yes
GNOME Terminal
yes
Konsole
yes
tmux
no
GNU screen
no

Related sequences