Source File
ctrl.go
Belonging Package
github.com/charmbracelet/x/ansi
package ansiimport ()// RequestNameVersion (XTVERSION) is a control sequence that requests the// terminal's name and version. It responds with a DSR sequence identifying the// terminal.//// CSI > 0 q// DCS > | text ST//// See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-PC-Style-Function-Keysconst (RequestNameVersion = "\x1b[>q"XTVERSION = RequestNameVersion)// RequestXTVersion is a control sequence that requests the terminal's XTVERSION. It responds with a DSR sequence identifying the version.//// CSI > Ps q// DCS > | text ST//// See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-PC-Style-Function-Keys//// Deprecated: use [RequestNameVersion] instead.const RequestXTVersion = RequestNameVersion// PrimaryDeviceAttributes (DA1) is a control sequence that reports the// terminal's primary device attributes.//// CSI c// CSI 0 c// CSI ? Ps ; ... c//// If no attributes are given, or if the attribute is 0, this function returns// the request sequence. Otherwise, it returns the response sequence.//// Common attributes include:// - 1 132 columns// - 2 Printer port// - 4 Sixel// - 6 Selective erase// - 7 Soft character set (DRCS)// - 8 User-defined keys (UDKs)// - 9 National replacement character sets (NRCS) (International terminal only)// - 12 Yugoslavian (SCS)// - 15 Technical character set// - 18 Windowing capability// - 21 Horizontal scrolling// - 23 Greek// - 24 Turkish// - 42 ISO Latin-2 character set// - 44 PCTerm// - 45 Soft key map// - 46 ASCII emulation//// See https://vt100.net/docs/vt510-rm/DA1.htmlfunc ( ...int) string {if len() == 0 {return RequestPrimaryDeviceAttributes} else if len() == 1 && [0] == 0 {return "\x1b[0c"}:= make([]string, len())for , := range {[] = strconv.Itoa()}return "\x1b[?" + strings.Join(, ";") + "c"}// DA1 is an alias for [PrimaryDeviceAttributes].func ( ...int) string {return PrimaryDeviceAttributes(...)}// RequestPrimaryDeviceAttributes is a control sequence that requests the// terminal's primary device attributes (DA1).//// CSI c//// See https://vt100.net/docs/vt510-rm/DA1.htmlconst RequestPrimaryDeviceAttributes = "\x1b[c"// SecondaryDeviceAttributes (DA2) is a control sequence that reports the// terminal's secondary device attributes.//// CSI > c// CSI > 0 c// CSI > Ps ; ... c//// See https://vt100.net/docs/vt510-rm/DA2.htmlfunc ( ...int) string {if len() == 0 {return RequestSecondaryDeviceAttributes}:= make([]string, len())for , := range {[] = strconv.Itoa()}return "\x1b[>" + strings.Join(, ";") + "c"}// DA2 is an alias for [SecondaryDeviceAttributes].func ( ...int) string {return SecondaryDeviceAttributes(...)}// RequestSecondaryDeviceAttributes is a control sequence that requests the// terminal's secondary device attributes (DA2).//// CSI > c//// See https://vt100.net/docs/vt510-rm/DA2.htmlconst RequestSecondaryDeviceAttributes = "\x1b[>c"// TertiaryDeviceAttributes (DA3) is a control sequence that reports the// terminal's tertiary device attributes.//// CSI = c// CSI = 0 c// DCS ! | Text ST//// Where Text is the unit ID for the terminal.//// If no unit ID is given, or if the unit ID is 0, this function returns the// request sequence. Otherwise, it returns the response sequence.//// See https://vt100.net/docs/vt510-rm/DA3.htmlfunc ( string) string {switch {case "":return RequestTertiaryDeviceAttributescase "0":return "\x1b[=0c"}return "\x1bP!|" + + "\x1b\\"}// DA3 is an alias for [TertiaryDeviceAttributes].func ( string) string {return TertiaryDeviceAttributes()}// RequestTertiaryDeviceAttributes is a control sequence that requests the// terminal's tertiary device attributes (DA3).//// CSI = c//// See https://vt100.net/docs/vt510-rm/DA3.htmlconst RequestTertiaryDeviceAttributes = "\x1b[=c"
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64)