Cotal TypeScript packages
    Preparing search index...

    Function isDetachPress

    • Whether a whole chunk d is exactly one press of the detach key byte, in any of three encodings: the legacy single control byte; the kitty keyboard protocol's CSI <codepoint> ; <mods> u; or xterm modifyOtherKeys's CSI 27 ; <mods> ; <codepoint> ~. <codepoint> is the decimal codepoint kitty/xterm report for the unshifted key: byte | 0x40 for the control punctuation (@ [ \ ] ^ _) and byte | 0x60 for a letter (kitty reports the lowercase key even though Ctrl was held). <mods> is 1 + the modifier bitmask and must carry the Ctrl bit ((mods - 1) & 4), so plain Ctrl (5) and Ctrl+Shift (6) match but a modifier field without Ctrl does not, and a field of 0, which neither protocol emits, is not a press either (the test needs that floor: (0 - 1) & 4 is 4 in ToInt32 arithmetic, so 0 would otherwise read as Ctrl). The match is on the WHOLE chunk: a sequence with company (a paste, a second keystroke, a trailing byte) is not a press, which is the same paste-safety property the one-byte test already had. This assumes one press arrives in one read, as measured on a pty (issue #598); a sequence split across two reads is not buffered and is not recognised. A kitty CSI u with an alternate-key <codepoint>:<shifted>:<base> triple is accepted by matching only the leading codepoint before an optional :... group; no other kitty event type (release, repeat) is recognised.

      Parameters

      • d: Buffer
      • byte: number

      Returns boolean