@xterm/xterm 5.6.0-beta.73 → 5.6.0-beta.75
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 +8 -8
- package/lib/xterm.mjs.map +3 -3
- package/package.json +2 -2
- package/src/browser/renderer/dom/DomRenderer.ts +8 -3
- package/src/common/InputHandler.ts +29 -23
- package/src/common/Types.ts +2 -0
- package/src/common/services/CoreService.ts +2 -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": "5.6.0-beta.
|
|
4
|
+
"version": "5.6.0-beta.75",
|
|
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": "
|
|
110
|
+
"commit": "ce095b35936844055924c9b66ec3e89aef5cbca4"
|
|
111
111
|
}
|
|
@@ -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
|
) {
|
|
@@ -161,6 +162,10 @@ export class DomRenderer extends Disposable implements IRenderer {
|
|
|
161
162
|
// Base CSS
|
|
162
163
|
let styles =
|
|
163
164
|
`${this._terminalSelector} .${ROW_CONTAINER_CLASS} {` +
|
|
165
|
+
// Disabling pointer events circumvents a browser behavior that prevents `click` events from
|
|
166
|
+
// being delivered if the target element is replaced during the click. This happened due to
|
|
167
|
+
// refresh() being called during the mousedown handler to start a selection.
|
|
168
|
+
` pointer-events: none;` +
|
|
164
169
|
` color: ${colors.foreground.css};` +
|
|
165
170
|
` font-family: ${this._optionsService.rawOptions.fontFamily};` +
|
|
166
171
|
` font-size: ${this._optionsService.rawOptions.fontSize}px;` +
|
|
@@ -437,8 +442,8 @@ export class DomRenderer extends Disposable implements IRenderer {
|
|
|
437
442
|
const buffer = this._bufferService.buffer;
|
|
438
443
|
const cursorAbsoluteY = buffer.ybase + buffer.y;
|
|
439
444
|
const cursorX = Math.min(buffer.x, this._bufferService.cols - 1);
|
|
440
|
-
const cursorBlink = this._optionsService.rawOptions.cursorBlink;
|
|
441
|
-
const cursorStyle = this._optionsService.rawOptions.cursorStyle;
|
|
445
|
+
const cursorBlink = this._coreService.decPrivateModes.cursorBlink ?? this._optionsService.rawOptions.cursorBlink;
|
|
446
|
+
const cursorStyle = this._coreService.decPrivateModes.cursorStyle ?? this._optionsService.rawOptions.cursorStyle;
|
|
442
447
|
const cursorInactiveStyle = this._optionsService.rawOptions.cursorInactiveStyle;
|
|
443
448
|
|
|
444
449
|
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 ->
|
|
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
|
-
* -
|
|
2728
|
-
* -
|
|
2729
|
-
* -
|
|
2730
|
-
* -
|
|
2731
|
-
* -
|
|
2732
|
-
* -
|
|
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]
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
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
|
|
package/src/common/Types.ts
CHANGED
|
@@ -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,
|