@xterm/xterm 6.1.0-beta.194 → 6.1.0-beta.196
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 +6 -6
- package/lib/xterm.mjs.map +3 -3
- package/package.json +2 -2
- package/src/common/TaskQueue.ts +1 -2
- package/src/common/Version.ts +1 -1
- package/src/common/input/KittyKeyboard.ts +21 -0
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.196",
|
|
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": "43162634574514212b759cd0c41e82dc3ce92410"
|
|
123
123
|
}
|
package/src/common/TaskQueue.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { isNode } from 'common/Platform';
|
|
7
6
|
import type { ILogService } from 'common/services/Services';
|
|
8
7
|
|
|
9
8
|
interface ITaskQueue {
|
|
@@ -148,7 +147,7 @@ class IdleTaskQueueInternal extends TaskQueue {
|
|
|
148
147
|
* This reverts to a {@link PriorityTaskQueue} if the environment does not support idle callbacks.
|
|
149
148
|
*/
|
|
150
149
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
151
|
-
export const IdleTaskQueue = (
|
|
150
|
+
export const IdleTaskQueue = ('requestIdleCallback' in globalThis) ? IdleTaskQueueInternal : PriorityTaskQueue;
|
|
152
151
|
|
|
153
152
|
/**
|
|
154
153
|
* An object that tracks a single debounced task that will run on the next idle frame. When called
|
package/src/common/Version.ts
CHANGED
|
@@ -265,6 +265,19 @@ export class KittyKeyboard {
|
|
|
265
265
|
return ev.key === 'Shift' || ev.key === 'Control' || ev.key === 'Alt' || ev.key === 'Meta';
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
/**
|
|
269
|
+
* Check if a key is a lock key (CapsLock/NumLock/ScrollLock).
|
|
270
|
+
*
|
|
271
|
+
* Kitty's reference implementation classifies these as modifier keys for the
|
|
272
|
+
* purpose of suppressing press events (kitty/keys.c `is_modifier_key()`
|
|
273
|
+
* includes `GLFW_FKEY_CAPS_LOCK`, `GLFW_FKEY_SCROLL_LOCK`, `GLFW_FKEY_NUM_LOCK`),
|
|
274
|
+
* and its test suite asserts that a CapsLock press with no protocol flags
|
|
275
|
+
* produces empty output.
|
|
276
|
+
*/
|
|
277
|
+
private _isLockKey(ev: IKeyboardEvent): boolean {
|
|
278
|
+
return ev.key === 'CapsLock' || ev.key === 'NumLock' || ev.key === 'ScrollLock';
|
|
279
|
+
}
|
|
280
|
+
|
|
268
281
|
/**
|
|
269
282
|
* Build CSI letter sequence for arrow keys, Home, End.
|
|
270
283
|
* Format: CSI [1;mod] letter
|
|
@@ -422,6 +435,14 @@ export class KittyKeyboard {
|
|
|
422
435
|
return result;
|
|
423
436
|
}
|
|
424
437
|
|
|
438
|
+
// Spec § "Report all keys as escape codes": "Additionally, with this mode,
|
|
439
|
+
// events for pressing modifier keys are reported." — i.e. *without* this
|
|
440
|
+
// mode, modifier-key press events are suppressed. Kitty's is_modifier_key()
|
|
441
|
+
// treats CapsLock/NumLock/ScrollLock as modifier keys for this rule.
|
|
442
|
+
if (this._isLockKey(ev) && !(flags & KittyKeyboardFlags.REPORT_ALL_KEYS_AS_ESCAPE_CODES)) {
|
|
443
|
+
return result;
|
|
444
|
+
}
|
|
445
|
+
|
|
425
446
|
const csiLetter = this._csiLetterKeys[ev.key];
|
|
426
447
|
if (csiLetter) {
|
|
427
448
|
result.key = this._buildCsiLetterSequence(csiLetter, modifiers, eventType, reportEventTypes);
|