main
1package ansi
2
3// SetIconNameWindowTitle returns a sequence for setting the icon name and
4// window title.
5//
6// OSC 0 ; title ST
7// OSC 0 ; title BEL
8//
9// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands
10func SetIconNameWindowTitle(s string) string {
11 return "\x1b]0;" + s + "\x07"
12}
13
14// SetIconName returns a sequence for setting the icon name.
15//
16// OSC 1 ; title ST
17// OSC 1 ; title BEL
18//
19// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands
20func SetIconName(s string) string {
21 return "\x1b]1;" + s + "\x07"
22}
23
24// SetWindowTitle returns a sequence for setting the window title.
25//
26// OSC 2 ; title ST
27// OSC 2 ; title BEL
28//
29// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands
30func SetWindowTitle(s string) string {
31 return "\x1b]2;" + s + "\x07"
32}