To add an annotation use on of these sequences: ^1337 AddAnnotation=message^G Rr, gg, bb are 2-digit hex value (for example, "ff").Įxample in bash that changes the foreground color blue: echo -e "\033]Pg4040ff\033\\" * If key is tab then a value of default removes the tab color and restores it to the system default.Ī second escape sequence is also supported, but its use is not recommended: ^Pnrrggbb^[\ * If key is preset then value should be the name of a color preset. The following alternate schemes are also supported: p3 (the standard P3 color space, whose gamut is supported on some newer hardware).If a color space is given, it should be one of: cs:RRGGBB (like RRGGBB but cs gives a color space).cs:RGB (like RGB but cs gives a color space).The accepted values are: fg bg bold link selbg selfg curbg curfg underline tab" black red green yellow blue magenta cyan white br_black br_red br_green br_yellow br_blue br_magenta br_cyan br_white To change the current session's colors use this code: ^1337 SetColors=key=value^G
To reset the window title and tab color, use this code: ^6 1 bg * default^Gįor example: echo -e "\033]6 1 bg * default\a" Replace N with a decimal value in 0 to 255.Įxample in bash that turns the background purple: echo -e "\033]6 1 bg red brightness 255\a"Įcho -e "\033]6 1 bg green brightness 0\a"Įcho -e "\033]6 1 bg blue brightness 255\a" To set the window title and tab color use this escape sequence: ^6 1 bg red brightness N^G Set window title and tab chrome background color
#BASH SCRIPT SEND GROWL NOTIFICATION CODE#
After this is sent, all text received is placed in the pasteboard until this code comes in: ^1337 EndCopy^G Where name is one of "rule", "find", "font", or empty to mean the general pasteboard (which is what you normally want). To place text in the pasteboard: ^1337 CopyToClipboard=name^G To change the session's profile on the fly: ^1337 SetProfile=NewProfileName^G This will have no effect if Growl is not running. To post a Growl notification: ^9 Message content goes here^G To inform iTerm2 of the current directory to help semantic history: ^1337 CurrentDir=/the/current/directory^G To erase the scrollback history: ^1337 ClearScrollback^G To bring iTerm2 to the foreground: ^1337 StealFocus^G The following escape code has the same effect as that command: ^1337 SetMark^G The "Set Mark" (cmd-shift-M) command allows you to record a location and then jump back to it later (with cmd-shift-J). vimrc to change cursor shape in insert mode: let &t_SI = "\]1337 CursorShape=1\x7"
Set cursor shape ^1337 CursorShape=N^GĪdd this to your. To open a link, hold Command and click the link. Typical usage would look like: ^8 to example website^8 ^G If the url is absent then that ends the hyperlink. Two adjacent hyperlinks with the same URL but different ids will highlight separately when Command is pressed during hover.
A key-value pair is formatted as key=value. Params consists of zero or more colon-delimited key-value pairs. VTE and iTerm2 support OSC 8 for defining hyperlinks, much like HTML's anchor tag. The OSC command 50 used to be used but it conflicts with xterm, so it is now 1337. Proceed with caution.Ī quick comment on notation: in this document, ^[ means "Escape" (hex code 0x1b) and ^G means "bel" (hex code 0x07). These may not work properly in tmux or screen, and may have unknown effects on other terminal emulators. ITerm2 supports several non-standard escape codes. WARNING: This document is for an older version of iTerm2.