@xterm/xterm 6.1.0-beta.216 → 6.1.0-beta.217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xterm.js +1 -1
- package/lib/xterm.js.map +1 -1
- package/lib/xterm.mjs +5 -5
- package/lib/xterm.mjs.map +3 -3
- package/package.json +2 -2
- package/src/common/Version.ts +1 -1
- package/src/common/input/KittyKeyboard.ts +25 -21
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/xterm",
|
|
3
3
|
"description": "Full xterm terminal, in your browser",
|
|
4
|
-
"version": "6.1.0-beta.
|
|
4
|
+
"version": "6.1.0-beta.217",
|
|
5
5
|
"main": "lib/xterm.js",
|
|
6
6
|
"module": "lib/xterm.mjs",
|
|
7
7
|
"style": "css/xterm.css",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"ws": "^8.2.3",
|
|
120
120
|
"xterm-benchmark": "^0.3.1"
|
|
121
121
|
},
|
|
122
|
-
"commit": "
|
|
122
|
+
"commit": "c5c6fc2a64dab42fad108493e2a33d6aa9cd4405"
|
|
123
123
|
}
|
package/src/common/Version.ts
CHANGED
|
@@ -471,30 +471,34 @@ export class KittyKeyboard {
|
|
|
471
471
|
return result;
|
|
472
472
|
}
|
|
473
473
|
|
|
474
|
-
|
|
474
|
+
// Special handling for Enter/Tab/Backspace.
|
|
475
|
+
const specialKey = keyCode === 13 || keyCode === 9 || keyCode === 127;
|
|
475
476
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
if (flags & KittyKeyboardFlags.REPORT_ALL_KEYS_AS_ESCAPE_CODES) {
|
|
479
|
-
|
|
480
|
-
} else if (reportEventTypes) {
|
|
481
|
-
useCsiU = true;
|
|
482
|
-
} else if (flags & KittyKeyboardFlags.DISAMBIGUATE_ESCAPE_CODES) {
|
|
483
|
-
// Per spec, Enter/Tab/Backspace "still generate the same bytes as in legacy
|
|
484
|
-
// mode" and consider space to be a text-generating key, so these skip the isFunc fast-path
|
|
485
|
-
// and only get CSI u when modifiers are present (handled below).
|
|
486
|
-
const isDisambiguateLegacy = keyCode === 13 || keyCode === 9 || keyCode === 127;
|
|
487
|
-
if (isFunc && !isDisambiguateLegacy) {
|
|
488
|
-
useCsiU = true;
|
|
489
|
-
} else if (modifiers > 0) {
|
|
490
|
-
if (ev.shiftKey && !ev.ctrlKey && !ev.altKey && !ev.metaKey && ev.key.length === 1) {
|
|
491
|
-
useCsiU = false;
|
|
492
|
-
} else {
|
|
493
|
-
useCsiU = true;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
477
|
+
// Per spec, Enter/Tab/Backspace will not have release events unless "Report all keys as escape
|
|
478
|
+
// codes" is also set.
|
|
479
|
+
if (specialKey && eventType === KittyKeyboardEventType.RELEASE && !(flags & KittyKeyboardFlags.REPORT_ALL_KEYS_AS_ESCAPE_CODES)) {
|
|
480
|
+
return result;
|
|
496
481
|
}
|
|
497
482
|
|
|
483
|
+
const isFunc = this._functionalKeyCodes[ev.key] !== undefined || this._getNumpadKeyCode(ev) !== undefined;
|
|
484
|
+
|
|
485
|
+
const useCsiU = !!(
|
|
486
|
+
flags & KittyKeyboardFlags.REPORT_ALL_KEYS_AS_ESCAPE_CODES ||
|
|
487
|
+
(reportEventTypes && eventType === KittyKeyboardEventType.RELEASE) ||
|
|
488
|
+
(flags & KittyKeyboardFlags.DISAMBIGUATE_ESCAPE_CODES &&
|
|
489
|
+
(
|
|
490
|
+
// Per spec, Enter/Tab/Backspace "still generate the same bytes as in legacy mode" and
|
|
491
|
+
// consider space to be a text-generating key, so these skip the isFunc fast-path and only
|
|
492
|
+
// get CSI u when modifiers are present (handled below).
|
|
493
|
+
(isFunc && !specialKey) ||
|
|
494
|
+
(
|
|
495
|
+
(modifiers > 0 && ev.key.length !== 1) ||
|
|
496
|
+
modifiers - 1 > KittyKeyboardModifiers.SHIFT
|
|
497
|
+
)
|
|
498
|
+
)
|
|
499
|
+
)
|
|
500
|
+
);
|
|
501
|
+
|
|
498
502
|
if (useCsiU) {
|
|
499
503
|
result.key = this._buildCsiUSequence(ev, keyCode, modifiers, eventType, flags, isFunc, isMod);
|
|
500
504
|
result.cancel = true;
|