

Key Description of value name base-64 encoded filename.
#Ansi escape sequences function keys code
In general, the pattern is:ĮSC ] 1337 key = value ^G Whitespace is shown here for ease of reading: in practice, no spaces should be used.įor file transfer and inline images, the code is:ĮSC ] 1337 File = : base-64 encoded file contents ^G The arguments are formatted as key=value with a semicolon between each key-value pair. ITerm2 extends the xterm protocol with a set of proprietary escape sequences.

The width and height are given as a number followed by a unit, or the word "auto". printf "\e]1337 SetBadgeFormat=%s\a" \ $(echo -n "\(session.name) \(user.gitBranch)" | base64) # Set badge to show the current session name and git branch, if any is set. OSC 1337 SetBadgeFormat=Base-64 encoded badge format ST Here's an example that works in bash: The badge may be set with the following control sequence: OSC 1337 ReportVariable= ST Where is a base64-encoded value. OSC 1337 ReportVariable= ST Where is a base64-encoded variable name, like session.name. This escape sequence reports a variable's value: OSC 1337 Copy=: ST Where is the base64-encoded string to copy to the pasteboard.Įach iTerm2 session has internal variables (as described in Scripting Fundamentals). You can place a string in the system's pasteboard with this sequence: and are floating point values giving the size in points of a single character cell. It could take other values in the future.

OSC 1337 ReportCellSize= ST gives the number of pixels (physical units) to points (logical units). OSC 1337 ReportCellSize= ST Or, in newer versions: OSC 1337 ReportCellSize ST The terminal responds with either: User confirmation is required as a security measure. If it is an empty string then the background image will be removed. OSC 1337 SetBackgroundImageFile= ST The value of is a base64-encoded filename to display as a background image. `` and ``: The starting coordinate for the annotation. Defaults to the rest of the line beginning at the start of the annotation. OSC 1337 AddAnnotation= ST OSC 1337 AddAnnotation= | ST OSC 1337 AddAnnotation= | | | ST OSC 1337 AddHiddenAnnotation= ST OSC 1337 AddHiddenAnnotation= | ST OSC 1337 AddHiddenAnnotation= | | | ST ``: The message to attach to the annotation. Srgb (the standard sRGB color space) rgb (the device-specific color space) p3 (the standard P3 color space, whose gamut is supported on some newer hardware) RGB (three hex digits, like fff) RRGGBB (six hex digits, like f0f0f0) cs:RGB (like RGB but cs gives a color space) cs:RRGGBB (like RRGGBB but cs gives a color space) If a color space is given, it should be one of: 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 Mark the current location and jump back to it with Command-Shift-J. These triplets may be 2 or 4 digits in each component. Returns an array reference of the decimal values for the Red, Green and Blue components of the background or foreground. Make foreground text the named color and bright (however your terminal does that). This dies if N is not a positive number between 0 and 255 (inclusive). Make the foreground the color N in the xterm 256 color chart. Use the background color for the text color, and the text color for the background. Put the cursor back to where you saved it. Make the text dark (however your terminal does that). Move the cursor up N lines, to the start of the line Move the cursor down N lines, to the start of the line Make the text invisible (if your terminal handles that). Each of these start at the current cursor position. Make the text blink (however your terminal does that).Ĭlear the part of the screen as indicated. Make the background the named color and bright (however your terminal does that). For example, ignore the ANSI sequences in computing length. Routines for dealing with text that contains ANSI code. I want to emit the sequence in a stream without knowing what's coming up. There are several modules that come close to this, but so far everything is incomplete or requires you to know all of the upcoming text ahead of time so you can use of it as an argument to a function. You can emit these without knowing what's coming up. Subroutines to deal with ANSI terminal sequences. Print bold, underline, text_red, "Hello", reset DESCRIPTION Antsy - Streaming ANSI escape sequences SYNOPSIS use Antsy qw(:all)
