forked from toolshed/abra
chore: make deps, go mod vendor
This commit is contained in:
36
vendor/github.com/charmbracelet/x/ansi/kitty.go
generated
vendored
36
vendor/github.com/charmbracelet/x/ansi/kitty.go
generated
vendored
@ -8,11 +8,11 @@ const (
|
||||
KittyDisambiguateEscapeCodes = 1 << iota
|
||||
KittyReportEventTypes
|
||||
KittyReportAlternateKeys
|
||||
KittyReportAllKeys
|
||||
KittyReportAllKeysAsEscapeCodes
|
||||
KittyReportAssociatedKeys
|
||||
|
||||
KittyAllFlags = KittyDisambiguateEscapeCodes | KittyReportEventTypes |
|
||||
KittyReportAlternateKeys | KittyReportAllKeys | KittyReportAssociatedKeys
|
||||
KittyReportAlternateKeys | KittyReportAllKeysAsEscapeCodes | KittyReportAssociatedKeys
|
||||
)
|
||||
|
||||
// RequestKittyKeyboard is a sequence to request the terminal Kitty keyboard
|
||||
@ -21,9 +21,41 @@ const (
|
||||
// See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
|
||||
const RequestKittyKeyboard = "\x1b[?u"
|
||||
|
||||
// KittyKeyboard returns a sequence to request keyboard enhancements from the terminal.
|
||||
// The flags argument is a bitmask of the Kitty keyboard protocol flags. While
|
||||
// mode specifies how the flags should be interpreted.
|
||||
//
|
||||
// Possible values for flags mask:
|
||||
//
|
||||
// 1: Disambiguate escape codes
|
||||
// 2: Report event types
|
||||
// 4: Report alternate keys
|
||||
// 8: Report all keys as escape codes
|
||||
// 16: Report associated text
|
||||
//
|
||||
// Possible values for mode:
|
||||
//
|
||||
// 1: Set given flags and unset all others
|
||||
// 2: Set given flags and keep existing flags unchanged
|
||||
// 3: Unset given flags and keep existing flags unchanged
|
||||
//
|
||||
// See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement
|
||||
func KittyKeyboard(flags, mode int) string {
|
||||
return "\x1b[=" + strconv.Itoa(flags) + ";" + strconv.Itoa(mode) + "u"
|
||||
}
|
||||
|
||||
// PushKittyKeyboard returns a sequence to push the given flags to the terminal
|
||||
// Kitty Keyboard stack.
|
||||
//
|
||||
// Possible values for flags mask:
|
||||
//
|
||||
// 0: Disable all features
|
||||
// 1: Disambiguate escape codes
|
||||
// 2: Report event types
|
||||
// 4: Report alternate keys
|
||||
// 8: Report all keys as escape codes
|
||||
// 16: Report associated text
|
||||
//
|
||||
// CSI > flags u
|
||||
//
|
||||
// See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement
|
||||
|
Reference in New Issue
Block a user