@xterm/xterm 5.6.0-beta.72 → 5.6.0-beta.74

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": "5.6.0-beta.72",
4
+ "version": "5.6.0-beta.74",
5
5
  "main": "lib/xterm.js",
6
6
  "module": "lib/xterm.mjs",
7
7
  "style": "css/xterm.css",
@@ -107,5 +107,5 @@
107
107
  "ws": "^8.2.3",
108
108
  "xterm-benchmark": "^0.3.1"
109
109
  },
110
- "commit": "318f3dc3786f0cbe5e4f3e45aaacca3c9106e314"
110
+ "commit": "5230e5aad079cb3a3c4bd0e9543717121be87661"
111
111
  }
@@ -437,7 +437,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
437
437
  this.screenElement.appendChild(this._helperContainer);
438
438
  fragment.appendChild(this.screenElement);
439
439
 
440
- this.textarea = this._document.createElement('textarea');
440
+ const textarea = this.textarea = this._document.createElement('textarea');
441
441
  this.textarea.classList.add('xterm-helper-textarea');
442
442
  this.textarea.setAttribute('aria-label', Strings.promptLabel.get());
443
443
  if (!Browser.isChromeOS) {
@@ -449,6 +449,8 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
449
449
  this.textarea.setAttribute('autocapitalize', 'off');
450
450
  this.textarea.setAttribute('spellcheck', 'false');
451
451
  this.textarea.tabIndex = 0;
452
+ this._register(this.optionsService.onSpecificOptionChange('disableStdin', () => textarea.readOnly = this.optionsService.rawOptions.disableStdin));
453
+ this.textarea.readOnly = this.optionsService.rawOptions.disableStdin;
452
454
 
453
455
  // Register the core browser service before the generic textarea handlers are registered so it
454
456
  // handles them first. Otherwise the renderers may use the wrong focus state.
@@ -13,7 +13,7 @@ import { ICharSizeService, ICoreBrowserService, IThemeService } from 'browser/se
13
13
  import { ILinkifier2, ILinkifierEvent, ITerminal, ReadonlyColorSet } from 'browser/Types';
14
14
  import { color } from 'common/Color';
15
15
  import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
16
- import { IBufferService, IInstantiationService, IOptionsService } from 'common/services/Services';
16
+ import { IBufferService, ICoreService, IInstantiationService, IOptionsService } from 'common/services/Services';
17
17
  import { Emitter } from 'vs/base/common/event';
18
18
 
19
19
 
@@ -59,6 +59,7 @@ export class DomRenderer extends Disposable implements IRenderer {
59
59
  @ICharSizeService private readonly _charSizeService: ICharSizeService,
60
60
  @IOptionsService private readonly _optionsService: IOptionsService,
61
61
  @IBufferService private readonly _bufferService: IBufferService,
62
+ @ICoreService private readonly _coreService: ICoreService,
62
63
  @ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,
63
64
  @IThemeService private readonly _themeService: IThemeService
64
65
  ) {
@@ -437,8 +438,8 @@ export class DomRenderer extends Disposable implements IRenderer {
437
438
  const buffer = this._bufferService.buffer;
438
439
  const cursorAbsoluteY = buffer.ybase + buffer.y;
439
440
  const cursorX = Math.min(buffer.x, this._bufferService.cols - 1);
440
- const cursorBlink = this._optionsService.rawOptions.cursorBlink;
441
- const cursorStyle = this._optionsService.rawOptions.cursorStyle;
441
+ const cursorBlink = this._coreService.decPrivateModes.cursorBlink ?? this._optionsService.rawOptions.cursorBlink;
442
+ const cursorStyle = this._coreService.decPrivateModes.cursorStyle ?? this._optionsService.rawOptions.cursorStyle;
442
443
  const cursorInactiveStyle = this._optionsService.rawOptions.cursorInactiveStyle;
443
444
 
444
445
  for (let y = start; y <= end; y++) {
@@ -2714,7 +2714,7 @@ export class InputHandler extends Disposable implements IInputHandler {
2714
2714
 
2715
2715
  /**
2716
2716
  * CSI Ps SP q Set cursor style (DECSCUSR, VT520).
2717
- * Ps = 0 -> blinking block.
2717
+ * Ps = 0 -> reset to option.
2718
2718
  * Ps = 1 -> blinking block (default).
2719
2719
  * Ps = 2 -> steady block.
2720
2720
  * Ps = 3 -> blinking underline.
@@ -2724,31 +2724,37 @@ export class InputHandler extends Disposable implements IInputHandler {
2724
2724
  *
2725
2725
  * @vt: #Y CSI DECSCUSR "Set Cursor Style" "CSI Ps SP q" "Set cursor style."
2726
2726
  * Supported cursor styles:
2727
- * - empty, 0 or 1: steady block
2728
- * - 2: blink block
2729
- * - 3: steady underline
2730
- * - 4: blink underline
2731
- * - 5: steady bar
2732
- * - 6: blink bar
2727
+ * - 0: reset to option
2728
+ * - empty, 1: blinking block
2729
+ * - 2: steady block
2730
+ * - 3: blinking underline
2731
+ * - 4: steady underline
2732
+ * - 5: blinking bar
2733
+ * - 6: steady bar
2733
2734
  */
2734
2735
  public setCursorStyle(params: IParams): boolean {
2735
- const param = params.params[0] || 1;
2736
- switch (param) {
2737
- case 1:
2738
- case 2:
2739
- this._optionsService.options.cursorStyle = 'block';
2740
- break;
2741
- case 3:
2742
- case 4:
2743
- this._optionsService.options.cursorStyle = 'underline';
2744
- break;
2745
- case 5:
2746
- case 6:
2747
- this._optionsService.options.cursorStyle = 'bar';
2748
- break;
2736
+ const param = params.length === 0 ? 1 : params.params[0];
2737
+ if (param === 0) {
2738
+ this._coreService.decPrivateModes.cursorStyle = undefined;
2739
+ this._coreService.decPrivateModes.cursorBlink = undefined;
2740
+ } else {
2741
+ switch (param) {
2742
+ case 1:
2743
+ case 2:
2744
+ this._coreService.decPrivateModes.cursorStyle = 'block';
2745
+ break;
2746
+ case 3:
2747
+ case 4:
2748
+ this._coreService.decPrivateModes.cursorStyle = 'underline';
2749
+ break;
2750
+ case 5:
2751
+ case 6:
2752
+ this._coreService.decPrivateModes.cursorStyle = 'bar';
2753
+ break;
2754
+ }
2755
+ const isBlinking = param % 2 === 1;
2756
+ this._coreService.decPrivateModes.cursorBlink = isBlinking;
2749
2757
  }
2750
- const isBlinking = param % 2 === 1;
2751
- this._optionsService.options.cursorBlink = isBlinking;
2752
2758
  return true;
2753
2759
  }
2754
2760
 
@@ -268,6 +268,8 @@ export interface IDecPrivateModes {
268
268
  applicationCursorKeys: boolean;
269
269
  applicationKeypad: boolean;
270
270
  bracketedPasteMode: boolean;
271
+ cursorBlink: boolean | undefined;
272
+ cursorStyle: CursorStyle | undefined;
271
273
  origin: boolean;
272
274
  reverseWraparound: boolean;
273
275
  sendFocus: boolean;
@@ -17,6 +17,8 @@ const DEFAULT_DEC_PRIVATE_MODES: IDecPrivateModes = Object.freeze({
17
17
  applicationCursorKeys: false,
18
18
  applicationKeypad: false,
19
19
  bracketedPasteMode: false,
20
+ cursorBlink: undefined,
21
+ cursorStyle: undefined,
20
22
  origin: false,
21
23
  reverseWraparound: false,
22
24
  sendFocus: false,