Skip to main content
ansicode

OSC 1 — Set icon name (separate from window title)

Set the X11-style icon name independent of the visible window title — historically the label shown when the window is minimised.

Byte forms

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

\\x1b[\x1b]1;ICON-NAME\x07
\\033[\033]1;ICON-NAME\007
\\e[\e]1;ICON-NAME\a
ESC [ESC ] 1 ; ICON-NAME BEL
hex1b 5d 31 3b ... 07

Description

OSC 1 sets the icon name — historically the short label X11 showed for a minimised window (versus OSC 2 which set the long title visible in the title bar). OSC 0 sets both at once; OSC 1 sets only the icon name; OSC 2 sets only the title. On X11/xterm + gnome-terminal + konsole + mlterm + foot this still works as designed — the window manager picks up the icon-name attribute via XSetWMIconName. On non-X11 terminals (Windows Terminal, iTerm2, kitty, alacritty, wezterm, ghostty) there is no separate icon-name surface to render to, so most ignore OSC 1 entirely or quietly treat it as a no-op. Use OSC 0 if you want both updated together (the safe default for cross-platform tools); use OSC 1 only when you specifically need to leave the title bar untouched while updating the minimised label.

Spec citation: xterm-ctlseqs (OSC 1)

Examples

bash
printf '\033]1;build-watch\007'   # icon name only; title bar untouched
python
import sys; sys.stdout.write('\x1b]1;build-watch\x07')
go
fmt.Print("\x1b]1;build-watch\x07")
javascript
process.stdout.write('\x1b]1;build-watch\x07')
c
printf("\x1b]1;build-watch\x07");

Terminal support

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

Related sequences

In the family cookbook

OSC cookbook · 2. Window & tab titles — `OSC 0 / 1 / 2`