Fix kitty keyboard "Report event types" behavior not matching spec
According to spec: - The Enter, Tab and Backspace keys will not have release events unless "Report all keys as escape codes" is also set. - Key events that result in text are reported as plain UTF-8 text, so events are not supported for them, unless the application requests "key report" mode. I checked kitty's behavior. While it does report release events for keys that result in text as CSI sequences, press and repeat events for these are reported as plain UTF-8 text. This commit changes Xterm.js to match this behavior.
This commit is contained in:
@@ -477,7 +477,12 @@ export class KittyKeyboard {
|
||||
|
||||
if (flags & KittyKeyboardFlags.REPORT_ALL_KEYS_AS_ESCAPE_CODES) {
|
||||
useCsiU = true;
|
||||
} else if (reportEventTypes) {
|
||||
} else if (reportEventTypes && eventType === KittyKeyboardEventType.RELEASE) {
|
||||
// Per spec, Enter/Tab/Backspace will not have release events unless "Report all keys as
|
||||
// escape codes" (which is handled by the branch above) is also set.
|
||||
if (keyCode === 13 || keyCode === 9 || keyCode === 127) {
|
||||
return result;
|
||||
}
|
||||
useCsiU = true;
|
||||
} else if (flags & KittyKeyboardFlags.DISAMBIGUATE_ESCAPE_CODES) {
|
||||
// Per spec, Enter/Tab/Backspace "still generate the same bytes as in legacy
|
||||
|
||||
Reference in New Issue
Block a user