Skip to main content
ansicode

SGR 3 — Italic

Render following text in italic; not universally supported.

Byte forms

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

\\x1b[\x1b[3m
\\033[\033[3m
\\e[\e[3m
ESC [ESC [ 3 m
hex1b 5b 33 6d

Description

Italic is the most fragile of the basic SGR attributes. xterm, iTerm2, kitty, alacritty, wezterm, Windows Terminal and modern gnome-terminal/konsole all honor it. The Linux console, traditional cmd.exe, and ConPTY treat it as a no-op. Some terminals reuse the bit for reverse video on monochrome displays. Disable with `\x1b[23m`.

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

Examples

bash
printf '\033[3mitalic\033[23m back\033[0m\n'
python
print('\x1b[3mitalic\x1b[0m')
go
fmt.Print("\x1b[3mitalic\x1b[0m")
javascript
console.log('\x1b[3mitalic\x1b[0m')
c
printf("\x1b[3mitalic\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