@xterm/xterm 6.1.0-beta.196 → 6.1.0-beta.197

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/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.196",
4
+ "version": "6.1.0-beta.197",
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": "43162634574514212b759cd0c41e82dc3ce92410"
122
+ "commit": "34e017935581b6e0081b0e2bebe53e3193b85be7"
123
123
  }
@@ -40,7 +40,7 @@ export class KeyboardService implements IKeyboardService {
40
40
  }
41
41
  const kittyFlags = this._coreService.kittyKeyboard.flags;
42
42
  return this.useKitty
43
- ? this._getKittyKeyboard().evaluate(event, kittyFlags, event.repeat ? KittyKeyboardEventType.REPEAT : KittyKeyboardEventType.PRESS)
43
+ ? this._getKittyKeyboard().evaluate(event, kittyFlags, event.repeat ? KittyKeyboardEventType.REPEAT : KittyKeyboardEventType.PRESS, isMac && this._optionsService.rawOptions.macOptionIsMeta)
44
44
  : evaluateKeyboardEvent(event, this._coreService.decPrivateModes.applicationCursorKeys, isMac, this._optionsService.rawOptions.macOptionIsMeta);
45
45
  }
46
46
 
@@ -51,7 +51,7 @@ export class KeyboardService implements IKeyboardService {
51
51
  }
52
52
  const kittyFlags = this._coreService.kittyKeyboard.flags;
53
53
  if (this.useKitty && (kittyFlags & KittyKeyboardFlags.REPORT_EVENT_TYPES)) {
54
- return this._getKittyKeyboard().evaluate(event, kittyFlags, KittyKeyboardEventType.RELEASE);
54
+ return this._getKittyKeyboard().evaluate(event, kittyFlags, KittyKeyboardEventType.RELEASE, isMac && this._optionsService.rawOptions.macOptionIsMeta);
55
55
  }
56
56
  return undefined;
57
57
  }
@@ -6,4 +6,4 @@
6
6
  /**
7
7
  * The xterm.js version. This is updated by the publish script from package.json.
8
8
  */
9
- export const XTERM_VERSION = '6.1.0-beta.196';
9
+ export const XTERM_VERSION = '6.1.0-beta.197';
@@ -218,7 +218,7 @@ export class KittyKeyboard {
218
218
  * Returns the lowercase codepoint for letters.
219
219
  * For shifted keys, uses the code property to get the base key.
220
220
  */
221
- private _getKeyCode(ev: IKeyboardEvent): number | undefined {
221
+ private _getKeyCode(ev: IKeyboardEvent, macOptionAsAlt: boolean): number | undefined {
222
222
  const numpadCode = this._getNumpadKeyCode(ev);
223
223
  if (numpadCode !== undefined) {
224
224
  return numpadCode;
@@ -234,7 +234,7 @@ export class KittyKeyboard {
234
234
  return funcCode;
235
235
  }
236
236
 
237
- if (ev.shiftKey && ev.code) {
237
+ if ((ev.shiftKey || (macOptionAsAlt && ev.altKey)) && ev.code) {
238
238
  if (ev.code.startsWith('Digit') && ev.code.length === 6) {
239
239
  const digit = ev.code.charAt(5);
240
240
  if (digit >= '0' && digit <= '9') {
@@ -410,12 +410,14 @@ export class KittyKeyboard {
410
410
  * @param ev The keyboard event.
411
411
  * @param flags The active Kitty keyboard enhancement flags.
412
412
  * @param eventType The event type (press, repeat, release).
413
+ * @param macOptionAsAlt When true, macOS Option-composed ev.key values are unwound via ev.code.
413
414
  * @returns The keyboard result with the encoded key sequence.
414
415
  */
415
416
  public evaluate(
416
417
  ev: IKeyboardEvent,
417
418
  flags: number,
418
- eventType: KittyKeyboardEventType = KittyKeyboardEventType.PRESS
419
+ eventType: KittyKeyboardEventType = KittyKeyboardEventType.PRESS,
420
+ macOptionAsAlt: boolean = false
419
421
  ): IKeyboardResult {
420
422
  const result: IKeyboardResult = {
421
423
  type: KeyboardResultType.SEND_KEY,
@@ -464,7 +466,7 @@ export class KittyKeyboard {
464
466
  return result;
465
467
  }
466
468
 
467
- const keyCode = this._getKeyCode(ev);
469
+ const keyCode = this._getKeyCode(ev, macOptionAsAlt);
468
470
  if (keyCode === undefined) {
469
471
  return result;
470
472
  }