@xterm/xterm 5.6.0-beta.14 → 5.6.0-beta.141
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/README.md +10 -3
- package/css/xterm.css +71 -4
- package/lib/xterm.js +1 -1
- package/lib/xterm.js.map +1 -1
- package/lib/xterm.mjs +53 -0
- package/lib/xterm.mjs.map +7 -0
- package/package.json +46 -35
- package/src/browser/AccessibilityManager.ts +54 -26
- package/src/browser/{Terminal.ts → CoreBrowserTerminal.ts} +159 -145
- package/src/browser/Linkifier.ts +26 -14
- package/src/browser/LocalizableStrings.ts +15 -4
- package/src/browser/TimeBasedDebouncer.ts +2 -2
- package/src/browser/{Types.d.ts → Types.ts} +67 -15
- package/src/browser/Viewport.ts +148 -370
- package/src/browser/decorations/BufferDecorationRenderer.ts +14 -9
- package/src/browser/decorations/OverviewRulerRenderer.ts +40 -44
- package/src/browser/input/CompositionHelper.ts +2 -1
- package/src/browser/input/MoveToCell.ts +3 -1
- package/src/browser/public/Terminal.ts +26 -19
- package/src/browser/renderer/dom/DomRenderer.ts +19 -14
- package/src/browser/renderer/dom/DomRendererRowFactory.ts +35 -15
- package/src/browser/renderer/shared/Constants.ts +0 -8
- package/src/browser/renderer/shared/Types.ts +84 -0
- package/src/browser/services/CharSizeService.ts +6 -6
- package/src/browser/services/CoreBrowserService.ts +16 -20
- package/src/browser/services/LinkProviderService.ts +2 -2
- package/src/browser/services/RenderService.ts +116 -25
- package/src/browser/services/SelectionService.ts +16 -8
- package/src/browser/services/Services.ts +13 -13
- package/src/browser/services/ThemeService.ts +19 -58
- package/src/browser/shared/Constants.ts +8 -0
- package/src/common/CircularList.ts +5 -5
- package/src/common/CoreTerminal.ts +35 -41
- package/src/common/InputHandler.ts +97 -59
- package/src/common/TaskQueue.ts +7 -7
- package/src/common/{Types.d.ts → Types.ts} +14 -17
- package/src/common/buffer/Buffer.ts +15 -7
- package/src/common/buffer/BufferReflow.ts +9 -6
- package/src/common/buffer/BufferSet.ts +5 -5
- package/src/common/buffer/Marker.ts +4 -4
- package/src/common/buffer/{Types.d.ts → Types.ts} +2 -2
- package/src/common/input/Keyboard.ts +0 -24
- package/src/common/input/WriteBuffer.ts +9 -8
- package/src/common/parser/EscapeSequenceParser.ts +4 -4
- package/src/common/public/BufferNamespaceApi.ts +3 -3
- package/src/common/services/BufferService.ts +14 -11
- package/src/common/services/CoreMouseService.ts +53 -6
- package/src/common/services/CoreService.ts +13 -8
- package/src/common/services/DecorationService.ts +8 -9
- package/src/common/services/InstantiationService.ts +1 -1
- package/src/common/services/LogService.ts +2 -2
- package/src/common/services/OptionsService.ts +8 -6
- package/src/common/services/ServiceRegistry.ts +1 -1
- package/src/common/services/Services.ts +39 -17
- package/src/common/services/UnicodeService.ts +2 -2
- package/src/vs/base/browser/browser.ts +141 -0
- package/src/vs/base/browser/canIUse.ts +49 -0
- package/src/vs/base/browser/dom.ts +2369 -0
- package/src/vs/base/browser/fastDomNode.ts +316 -0
- package/src/vs/base/browser/globalPointerMoveMonitor.ts +112 -0
- package/src/vs/base/browser/iframe.ts +135 -0
- package/src/vs/base/browser/keyboardEvent.ts +213 -0
- package/src/vs/base/browser/mouseEvent.ts +229 -0
- package/src/vs/base/browser/touch.ts +372 -0
- package/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts +303 -0
- package/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts +114 -0
- package/src/vs/base/browser/ui/scrollbar/scrollableElement.ts +720 -0
- package/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts +165 -0
- package/src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts +114 -0
- package/src/vs/base/browser/ui/scrollbar/scrollbarState.ts +243 -0
- package/src/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.ts +118 -0
- package/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts +116 -0
- package/src/vs/base/browser/ui/widget.ts +57 -0
- package/src/vs/base/browser/window.ts +14 -0
- package/src/vs/base/common/arrays.ts +887 -0
- package/src/vs/base/common/arraysFind.ts +202 -0
- package/src/vs/base/common/assert.ts +71 -0
- package/src/vs/base/common/async.ts +1992 -0
- package/src/vs/base/common/cancellation.ts +148 -0
- package/src/vs/base/common/charCode.ts +450 -0
- package/src/vs/base/common/collections.ts +140 -0
- package/src/vs/base/common/decorators.ts +130 -0
- package/src/vs/base/common/equals.ts +146 -0
- package/src/vs/base/common/errors.ts +303 -0
- package/src/vs/base/common/event.ts +1778 -0
- package/src/vs/base/common/functional.ts +32 -0
- package/src/vs/base/common/hash.ts +316 -0
- package/src/vs/base/common/iterator.ts +159 -0
- package/src/vs/base/common/keyCodes.ts +526 -0
- package/src/vs/base/common/keybindings.ts +284 -0
- package/src/vs/base/common/lazy.ts +47 -0
- package/src/vs/base/common/lifecycle.ts +801 -0
- package/src/vs/base/common/linkedList.ts +142 -0
- package/src/vs/base/common/map.ts +202 -0
- package/src/vs/base/common/numbers.ts +98 -0
- package/src/vs/base/common/observable.ts +76 -0
- package/src/vs/base/common/observableInternal/api.ts +31 -0
- package/src/vs/base/common/observableInternal/autorun.ts +281 -0
- package/src/vs/base/common/observableInternal/base.ts +489 -0
- package/src/vs/base/common/observableInternal/debugName.ts +145 -0
- package/src/vs/base/common/observableInternal/derived.ts +428 -0
- package/src/vs/base/common/observableInternal/lazyObservableValue.ts +146 -0
- package/src/vs/base/common/observableInternal/logging.ts +328 -0
- package/src/vs/base/common/observableInternal/promise.ts +209 -0
- package/src/vs/base/common/observableInternal/utils.ts +610 -0
- package/src/vs/base/common/platform.ts +281 -0
- package/src/vs/base/common/scrollable.ts +522 -0
- package/src/vs/base/common/sequence.ts +34 -0
- package/src/vs/base/common/stopwatch.ts +43 -0
- package/src/vs/base/common/strings.ts +557 -0
- package/src/vs/base/common/symbols.ts +9 -0
- package/src/vs/base/common/uint.ts +59 -0
- package/src/vs/patches/nls.ts +90 -0
- package/src/vs/typings/base-common.d.ts +20 -0
- package/src/vs/typings/require.d.ts +42 -0
- package/src/vs/typings/vscode-globals-nls.d.ts +36 -0
- package/src/vs/typings/vscode-globals-product.d.ts +33 -0
- package/typings/xterm.d.ts +87 -14
- package/src/browser/Lifecycle.ts +0 -33
- package/src/browser/renderer/shared/CellColorResolver.ts +0 -236
- package/src/browser/renderer/shared/CharAtlasCache.ts +0 -96
- package/src/browser/renderer/shared/CharAtlasUtils.ts +0 -75
- package/src/browser/renderer/shared/CursorBlinkStateManager.ts +0 -146
- package/src/browser/renderer/shared/CustomGlyphs.ts +0 -687
- package/src/browser/renderer/shared/DevicePixelObserver.ts +0 -41
- package/src/browser/renderer/shared/TextureAtlas.ts +0 -1100
- package/src/browser/renderer/shared/Types.d.ts +0 -173
- package/src/common/EventEmitter.ts +0 -78
- package/src/common/Lifecycle.ts +0 -108
- /package/src/browser/selection/{Types.d.ts → Types.ts} +0 -0
- /package/src/common/parser/{Types.d.ts → Types.ts} +0 -0
|
@@ -21,15 +21,13 @@
|
|
|
21
21
|
* http://linux.die.net/man/7/urxvt
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
|
|
25
24
|
import { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, ICoreMouseService, IUnicodeService, LogLevelEnum, ITerminalOptions, IOscLinkService } from 'common/services/Services';
|
|
26
25
|
import { InstantiationService } from 'common/services/InstantiationService';
|
|
27
26
|
import { LogService } from 'common/services/LogService';
|
|
28
27
|
import { BufferService, MINIMUM_COLS, MINIMUM_ROWS } from 'common/services/BufferService';
|
|
29
28
|
import { OptionsService } from 'common/services/OptionsService';
|
|
30
|
-
import { IDisposable, IAttributeData, ICoreTerminal, IScrollEvent
|
|
29
|
+
import { IDisposable, IAttributeData, ICoreTerminal, IScrollEvent } from 'common/Types';
|
|
31
30
|
import { CoreService } from 'common/services/CoreService';
|
|
32
|
-
import { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';
|
|
33
31
|
import { CoreMouseService } from 'common/services/CoreMouseService';
|
|
34
32
|
import { UnicodeService } from 'common/services/UnicodeService';
|
|
35
33
|
import { CharsetService } from 'common/services/CharsetService';
|
|
@@ -39,6 +37,8 @@ import { IBufferSet } from 'common/buffer/Types';
|
|
|
39
37
|
import { InputHandler } from 'common/InputHandler';
|
|
40
38
|
import { WriteBuffer } from 'common/input/WriteBuffer';
|
|
41
39
|
import { OscLinkService } from 'common/services/OscLinkService';
|
|
40
|
+
import { Emitter, Event } from 'vs/base/common/event';
|
|
41
|
+
import { Disposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
|
42
42
|
|
|
43
43
|
// Only trigger this warning a single time per session
|
|
44
44
|
let hasWriteSyncWarnHappened = false;
|
|
@@ -57,28 +57,28 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
|
|
57
57
|
|
|
58
58
|
protected _inputHandler: InputHandler;
|
|
59
59
|
private _writeBuffer: WriteBuffer;
|
|
60
|
-
private _windowsWrappingHeuristics = this.
|
|
60
|
+
private _windowsWrappingHeuristics = this._register(new MutableDisposable());
|
|
61
61
|
|
|
62
|
-
private readonly _onBinary = this.
|
|
62
|
+
private readonly _onBinary = this._register(new Emitter<string>());
|
|
63
63
|
public readonly onBinary = this._onBinary.event;
|
|
64
|
-
private readonly _onData = this.
|
|
64
|
+
private readonly _onData = this._register(new Emitter<string>());
|
|
65
65
|
public readonly onData = this._onData.event;
|
|
66
|
-
protected _onLineFeed = this.
|
|
66
|
+
protected _onLineFeed = this._register(new Emitter<void>());
|
|
67
67
|
public readonly onLineFeed = this._onLineFeed.event;
|
|
68
|
-
private readonly _onResize = this.
|
|
68
|
+
private readonly _onResize = this._register(new Emitter<{ cols: number, rows: number }>());
|
|
69
69
|
public readonly onResize = this._onResize.event;
|
|
70
|
-
protected readonly _onWriteParsed = this.
|
|
70
|
+
protected readonly _onWriteParsed = this._register(new Emitter<void>());
|
|
71
71
|
public readonly onWriteParsed = this._onWriteParsed.event;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Internally we track the source of the scroll but this is meaningless outside the library so
|
|
75
75
|
* it's filtered out.
|
|
76
76
|
*/
|
|
77
|
-
protected _onScrollApi?:
|
|
78
|
-
protected _onScroll = this.
|
|
79
|
-
public get onScroll():
|
|
77
|
+
protected _onScrollApi?: Emitter<number>;
|
|
78
|
+
protected _onScroll = this._register(new Emitter<IScrollEvent>());
|
|
79
|
+
public get onScroll(): Event<number> {
|
|
80
80
|
if (!this._onScrollApi) {
|
|
81
|
-
this._onScrollApi = this.
|
|
81
|
+
this._onScrollApi = this._register(new Emitter<number>());
|
|
82
82
|
this._onScroll.event(ev => {
|
|
83
83
|
this._onScrollApi?.fire(ev.position);
|
|
84
84
|
});
|
|
@@ -103,17 +103,17 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
|
|
103
103
|
|
|
104
104
|
// Setup and initialize services
|
|
105
105
|
this._instantiationService = new InstantiationService();
|
|
106
|
-
this.optionsService = this.
|
|
106
|
+
this.optionsService = this._register(new OptionsService(options));
|
|
107
107
|
this._instantiationService.setService(IOptionsService, this.optionsService);
|
|
108
|
-
this._bufferService = this.
|
|
108
|
+
this._bufferService = this._register(this._instantiationService.createInstance(BufferService));
|
|
109
109
|
this._instantiationService.setService(IBufferService, this._bufferService);
|
|
110
|
-
this._logService = this.
|
|
110
|
+
this._logService = this._register(this._instantiationService.createInstance(LogService));
|
|
111
111
|
this._instantiationService.setService(ILogService, this._logService);
|
|
112
|
-
this.coreService = this.
|
|
112
|
+
this.coreService = this._register(this._instantiationService.createInstance(CoreService));
|
|
113
113
|
this._instantiationService.setService(ICoreService, this.coreService);
|
|
114
|
-
this.coreMouseService = this.
|
|
114
|
+
this.coreMouseService = this._register(this._instantiationService.createInstance(CoreMouseService));
|
|
115
115
|
this._instantiationService.setService(ICoreMouseService, this.coreMouseService);
|
|
116
|
-
this.unicodeService = this.
|
|
116
|
+
this.unicodeService = this._register(this._instantiationService.createInstance(UnicodeService));
|
|
117
117
|
this._instantiationService.setService(IUnicodeService, this.unicodeService);
|
|
118
118
|
this._charsetService = this._instantiationService.createInstance(CharsetService);
|
|
119
119
|
this._instantiationService.setService(ICharsetService, this._charsetService);
|
|
@@ -122,29 +122,24 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
// Register input handler and handle/forward events
|
|
125
|
-
this._inputHandler = this.
|
|
126
|
-
this.
|
|
127
|
-
this.
|
|
125
|
+
this._inputHandler = this._register(new InputHandler(this._bufferService, this._charsetService, this.coreService, this._logService, this.optionsService, this._oscLinkService, this.coreMouseService, this.unicodeService));
|
|
126
|
+
this._register(Event.forward(this._inputHandler.onLineFeed, this._onLineFeed));
|
|
127
|
+
this._register(this._inputHandler);
|
|
128
128
|
|
|
129
129
|
// Setup listeners
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
137
|
-
this._onScroll.fire({ position: this._bufferService.buffer.ydisp
|
|
130
|
+
this._register(Event.forward(this._bufferService.onResize, this._onResize));
|
|
131
|
+
this._register(Event.forward(this.coreService.onData, this._onData));
|
|
132
|
+
this._register(Event.forward(this.coreService.onBinary, this._onBinary));
|
|
133
|
+
this._register(this.coreService.onRequestScrollToBottom(() => this.scrollToBottom(true)));
|
|
134
|
+
this._register(this.coreService.onUserInput(() => this._writeBuffer.handleUserInput()));
|
|
135
|
+
this._register(this.optionsService.onMultipleOptionChange(['windowsMode', 'windowsPty'], () => this._handleWindowsPtyOptionChange()));
|
|
136
|
+
this._register(this._bufferService.onScroll(() => {
|
|
137
|
+
this._onScroll.fire({ position: this._bufferService.buffer.ydisp });
|
|
138
138
|
this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
|
|
139
139
|
}));
|
|
140
|
-
this.register(this._inputHandler.onScroll(event => {
|
|
141
|
-
this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: ScrollSource.TERMINAL });
|
|
142
|
-
this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
|
|
143
|
-
}));
|
|
144
|
-
|
|
145
140
|
// Setup WriteBuffer
|
|
146
|
-
this._writeBuffer = this.
|
|
147
|
-
this.
|
|
141
|
+
this._writeBuffer = this._register(new WriteBuffer((data, promiseResult) => this._inputHandler.parse(data, promiseResult)));
|
|
142
|
+
this._register(Event.forward(this._writeBuffer.onWriteParsed, this._onWriteParsed));
|
|
148
143
|
}
|
|
149
144
|
|
|
150
145
|
public write(data: string | Uint8Array, callback?: () => void): void {
|
|
@@ -198,10 +193,9 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
|
|
198
193
|
* @param suppressScrollEvent Don't emit the scroll event as scrollLines. This is used to avoid
|
|
199
194
|
* unwanted events being handled by the viewport when the event was triggered from the viewport
|
|
200
195
|
* originally.
|
|
201
|
-
* @param source Which component the event came from.
|
|
202
196
|
*/
|
|
203
|
-
public scrollLines(disp: number, suppressScrollEvent?: boolean
|
|
204
|
-
this._bufferService.scrollLines(disp, suppressScrollEvent
|
|
197
|
+
public scrollLines(disp: number, suppressScrollEvent?: boolean): void {
|
|
198
|
+
this._bufferService.scrollLines(disp, suppressScrollEvent);
|
|
205
199
|
}
|
|
206
200
|
|
|
207
201
|
public scrollPages(pageCount: number): void {
|
|
@@ -212,7 +206,7 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
|
|
212
206
|
this.scrollLines(-this._bufferService.buffer.ydisp);
|
|
213
207
|
}
|
|
214
208
|
|
|
215
|
-
public scrollToBottom(): void {
|
|
209
|
+
public scrollToBottom(disableSmoothScroll?: boolean): void {
|
|
216
210
|
this.scrollLines(this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
|
|
217
211
|
}
|
|
218
212
|
|
|
@@ -8,10 +8,9 @@ import { IInputHandler, IAttributeData, IDisposable, IWindowOptions, IColorEvent
|
|
|
8
8
|
import { C0, C1 } from 'common/data/EscapeSequences';
|
|
9
9
|
import { CHARSETS, DEFAULT_CHARSET } from 'common/data/Charsets';
|
|
10
10
|
import { EscapeSequenceParser } from 'common/parser/EscapeSequenceParser';
|
|
11
|
-
import { Disposable } from 'common/
|
|
11
|
+
import { Disposable } from 'vs/base/common/lifecycle';
|
|
12
12
|
import { StringToUtf32, stringFromCodePoint, Utf8ToUtf32 } from 'common/input/TextDecoder';
|
|
13
13
|
import { BufferLine, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
|
14
|
-
import { EventEmitter } from 'common/EventEmitter';
|
|
15
14
|
import { IParsingState, IEscapeSequenceParser, IParams, IFunctionIdentifier } from 'common/parser/Types';
|
|
16
15
|
import { NULL_CELL_CODE, NULL_CELL_WIDTH, Attributes, FgFlags, BgFlags, Content, UnderlineStyle } from 'common/buffer/Constants';
|
|
17
16
|
import { CellData } from 'common/buffer/CellData';
|
|
@@ -22,6 +21,7 @@ import { OscHandler } from 'common/parser/OscParser';
|
|
|
22
21
|
import { DcsHandler } from 'common/parser/DcsParser';
|
|
23
22
|
import { IBuffer } from 'common/buffer/Types';
|
|
24
23
|
import { parseColor } from 'common/input/XParseColor';
|
|
24
|
+
import { Emitter } from 'vs/base/common/event';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Map collect to glevel. Used in `selectCharset`.
|
|
@@ -119,7 +119,6 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
119
119
|
private _parseBuffer: Uint32Array = new Uint32Array(4096);
|
|
120
120
|
private _stringDecoder: StringToUtf32 = new StringToUtf32();
|
|
121
121
|
private _utf8Decoder: Utf8ToUtf32 = new Utf8ToUtf32();
|
|
122
|
-
private _workCell: CellData = new CellData();
|
|
123
122
|
private _windowTitle = '';
|
|
124
123
|
private _iconName = '';
|
|
125
124
|
private _dirtyRowTracker: IDirtyRowTracker;
|
|
@@ -132,32 +131,32 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
132
131
|
|
|
133
132
|
private _activeBuffer: IBuffer;
|
|
134
133
|
|
|
135
|
-
private readonly _onRequestBell = this.
|
|
134
|
+
private readonly _onRequestBell = this._register(new Emitter<void>());
|
|
136
135
|
public readonly onRequestBell = this._onRequestBell.event;
|
|
137
|
-
private readonly _onRequestRefreshRows = this.
|
|
136
|
+
private readonly _onRequestRefreshRows = this._register(new Emitter<{ start: number, end: number } | undefined>());
|
|
138
137
|
public readonly onRequestRefreshRows = this._onRequestRefreshRows.event;
|
|
139
|
-
private readonly _onRequestReset = this.
|
|
138
|
+
private readonly _onRequestReset = this._register(new Emitter<void>());
|
|
140
139
|
public readonly onRequestReset = this._onRequestReset.event;
|
|
141
|
-
private readonly _onRequestSendFocus = this.
|
|
140
|
+
private readonly _onRequestSendFocus = this._register(new Emitter<void>());
|
|
142
141
|
public readonly onRequestSendFocus = this._onRequestSendFocus.event;
|
|
143
|
-
private readonly _onRequestSyncScrollBar = this.
|
|
142
|
+
private readonly _onRequestSyncScrollBar = this._register(new Emitter<void>());
|
|
144
143
|
public readonly onRequestSyncScrollBar = this._onRequestSyncScrollBar.event;
|
|
145
|
-
private readonly _onRequestWindowsOptionsReport = this.
|
|
144
|
+
private readonly _onRequestWindowsOptionsReport = this._register(new Emitter<WindowsOptionsReportType>());
|
|
146
145
|
public readonly onRequestWindowsOptionsReport = this._onRequestWindowsOptionsReport.event;
|
|
147
146
|
|
|
148
|
-
private readonly _onA11yChar = this.
|
|
147
|
+
private readonly _onA11yChar = this._register(new Emitter<string>());
|
|
149
148
|
public readonly onA11yChar = this._onA11yChar.event;
|
|
150
|
-
private readonly _onA11yTab = this.
|
|
149
|
+
private readonly _onA11yTab = this._register(new Emitter<number>());
|
|
151
150
|
public readonly onA11yTab = this._onA11yTab.event;
|
|
152
|
-
private readonly _onCursorMove = this.
|
|
151
|
+
private readonly _onCursorMove = this._register(new Emitter<void>());
|
|
153
152
|
public readonly onCursorMove = this._onCursorMove.event;
|
|
154
|
-
private readonly _onLineFeed = this.
|
|
153
|
+
private readonly _onLineFeed = this._register(new Emitter<void>());
|
|
155
154
|
public readonly onLineFeed = this._onLineFeed.event;
|
|
156
|
-
private readonly _onScroll = this.
|
|
155
|
+
private readonly _onScroll = this._register(new Emitter<number>());
|
|
157
156
|
public readonly onScroll = this._onScroll.event;
|
|
158
|
-
private readonly _onTitleChange = this.
|
|
157
|
+
private readonly _onTitleChange = this._register(new Emitter<string>());
|
|
159
158
|
public readonly onTitleChange = this._onTitleChange.event;
|
|
160
|
-
private readonly _onColor = this.
|
|
159
|
+
private readonly _onColor = this._register(new Emitter<IColorEvent>());
|
|
161
160
|
public readonly onColor = this._onColor.event;
|
|
162
161
|
|
|
163
162
|
private _parseStack: IParseStack = {
|
|
@@ -180,12 +179,12 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
180
179
|
private readonly _parser: IEscapeSequenceParser = new EscapeSequenceParser()
|
|
181
180
|
) {
|
|
182
181
|
super();
|
|
183
|
-
this.
|
|
182
|
+
this._register(this._parser);
|
|
184
183
|
this._dirtyRowTracker = new DirtyRowTracker(this._bufferService);
|
|
185
184
|
|
|
186
185
|
// Track properties used in performance critical code manually to avoid using slow getters
|
|
187
186
|
this._activeBuffer = this._bufferService.buffer;
|
|
188
|
-
this.
|
|
187
|
+
this._register(this._bufferService.buffers.onBufferActivate(e => this._activeBuffer = e.activeBuffer));
|
|
189
188
|
|
|
190
189
|
/**
|
|
191
190
|
* custom fallback handlers
|
|
@@ -446,7 +445,10 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
446
445
|
|
|
447
446
|
// Log debug data, the log level gate is to prevent extra work in this hot path
|
|
448
447
|
if (this._logService.logLevel <= LogLevelEnum.DEBUG) {
|
|
449
|
-
this._logService.debug(`parsing data${typeof data === 'string' ? ` "${data}"` : ` "${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}"`}
|
|
448
|
+
this._logService.debug(`parsing data ${typeof data === 'string' ? ` "${data}"` : ` "${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}"`}`);
|
|
449
|
+
}
|
|
450
|
+
if (this._logService.logLevel === LogLevelEnum.TRACE) {
|
|
451
|
+
this._logService.trace(`parsing data (codes)`, typeof data === 'string'
|
|
450
452
|
? data.split('').map(e => e.charCodeAt(0))
|
|
451
453
|
: data
|
|
452
454
|
);
|
|
@@ -500,7 +502,10 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
500
502
|
const viewportEnd = this._dirtyRowTracker.end + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
|
|
501
503
|
const viewportStart = this._dirtyRowTracker.start + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
|
|
502
504
|
if (viewportStart < this._bufferService.rows) {
|
|
503
|
-
this._onRequestRefreshRows.fire(
|
|
505
|
+
this._onRequestRefreshRows.fire({
|
|
506
|
+
start: Math.min(viewportStart, this._bufferService.rows - 1),
|
|
507
|
+
end: Math.min(viewportEnd, this._bufferService.rows - 1)
|
|
508
|
+
});
|
|
504
509
|
}
|
|
505
510
|
}
|
|
506
511
|
|
|
@@ -604,7 +609,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
604
609
|
// since an empty cell is only set by fullwidth chars
|
|
605
610
|
bufferRow.addCodepointToCell(this._activeBuffer.x - offset,
|
|
606
611
|
code, chWidth);
|
|
607
|
-
for (let delta = chWidth - oldWidth; --delta >= 0;
|
|
612
|
+
for (let delta = chWidth - oldWidth; --delta >= 0;) {
|
|
608
613
|
bufferRow.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, curAttr);
|
|
609
614
|
}
|
|
610
615
|
continue;
|
|
@@ -1218,12 +1223,27 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
1218
1223
|
this._dirtyRowTracker.markDirty(0);
|
|
1219
1224
|
break;
|
|
1220
1225
|
case 2:
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1226
|
+
if (this._optionsService.rawOptions.scrollOnEraseInDisplay) {
|
|
1227
|
+
j = this._bufferService.rows;
|
|
1228
|
+
this._dirtyRowTracker.markRangeDirty(0, j - 1);
|
|
1229
|
+
while (j--) {
|
|
1230
|
+
const currentLine = this._activeBuffer.lines.get(this._activeBuffer.ybase + j);
|
|
1231
|
+
if (currentLine?.getTrimmedLength()) {
|
|
1232
|
+
break;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
for (; j >= 0; j--) {
|
|
1236
|
+
this._bufferService.scroll(this._eraseAttrData());
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
else {
|
|
1240
|
+
j = this._bufferService.rows;
|
|
1241
|
+
this._dirtyRowTracker.markDirty(j - 1);
|
|
1242
|
+
while (j--) {
|
|
1243
|
+
this._resetBufferLine(j, respectProtect);
|
|
1244
|
+
}
|
|
1245
|
+
this._dirtyRowTracker.markDirty(0);
|
|
1225
1246
|
}
|
|
1226
|
-
this._dirtyRowTracker.markDirty(0);
|
|
1227
1247
|
break;
|
|
1228
1248
|
case 3:
|
|
1229
1249
|
// Clear scrollback (everything not in viewport)
|
|
@@ -1605,7 +1625,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
1605
1625
|
const text = bufferRow.getString(x);
|
|
1606
1626
|
const data = new Uint32Array(text.length * length);
|
|
1607
1627
|
let idata = 0;
|
|
1608
|
-
for (let itext = 0; itext < text.length;
|
|
1628
|
+
for (let itext = 0; itext < text.length;) {
|
|
1609
1629
|
const ch = text.codePointAt(itext) || 0;
|
|
1610
1630
|
data[idata++] = ch;
|
|
1611
1631
|
itext += ch > 0xffff ? 2 : 1;
|
|
@@ -1943,12 +1963,15 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
1943
1963
|
case 1047: // alt screen buffer
|
|
1944
1964
|
this._bufferService.buffers.activateAltBuffer(this._eraseAttrData());
|
|
1945
1965
|
this._coreService.isCursorInitialized = true;
|
|
1946
|
-
this._onRequestRefreshRows.fire(
|
|
1966
|
+
this._onRequestRefreshRows.fire(undefined);
|
|
1947
1967
|
this._onRequestSyncScrollBar.fire();
|
|
1948
1968
|
break;
|
|
1949
1969
|
case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)
|
|
1950
1970
|
this._coreService.decPrivateModes.bracketedPasteMode = true;
|
|
1951
1971
|
break;
|
|
1972
|
+
case 2026: // synchronized output (https://github.com/contour-terminal/vt-extensions/blob/master/synchronized-output.md)
|
|
1973
|
+
this._coreService.decPrivateModes.synchronizedOutput = true;
|
|
1974
|
+
break;
|
|
1952
1975
|
}
|
|
1953
1976
|
}
|
|
1954
1977
|
return true;
|
|
@@ -2171,12 +2194,16 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
2171
2194
|
this.restoreCursor();
|
|
2172
2195
|
}
|
|
2173
2196
|
this._coreService.isCursorInitialized = true;
|
|
2174
|
-
this._onRequestRefreshRows.fire(
|
|
2197
|
+
this._onRequestRefreshRows.fire(undefined);
|
|
2175
2198
|
this._onRequestSyncScrollBar.fire();
|
|
2176
2199
|
break;
|
|
2177
2200
|
case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)
|
|
2178
2201
|
this._coreService.decPrivateModes.bracketedPasteMode = false;
|
|
2179
2202
|
break;
|
|
2203
|
+
case 2026: // synchronized output (https://github.com/contour-terminal/vt-extensions/blob/master/synchronized-output.md)
|
|
2204
|
+
this._coreService.decPrivateModes.synchronizedOutput = false;
|
|
2205
|
+
this._onRequestRefreshRows.fire(undefined);
|
|
2206
|
+
break;
|
|
2180
2207
|
}
|
|
2181
2208
|
}
|
|
2182
2209
|
return true;
|
|
@@ -2271,6 +2298,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
2271
2298
|
if (p === 1048) return f(p, V.SET); // xterm always returns SET here
|
|
2272
2299
|
if (p === 47 || p === 1047 || p === 1049) return f(p, b2v(active === alt));
|
|
2273
2300
|
if (p === 2004) return f(p, b2v(dm.bracketedPasteMode));
|
|
2301
|
+
if (p === 2026) return f(p, b2v(dm.synchronizedOutput));
|
|
2274
2302
|
return f(p, V.NOT_RECOGNIZED);
|
|
2275
2303
|
}
|
|
2276
2304
|
|
|
@@ -2712,7 +2740,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
2712
2740
|
|
|
2713
2741
|
/**
|
|
2714
2742
|
* CSI Ps SP q Set cursor style (DECSCUSR, VT520).
|
|
2715
|
-
* Ps = 0 ->
|
|
2743
|
+
* Ps = 0 -> reset to option.
|
|
2716
2744
|
* Ps = 1 -> blinking block (default).
|
|
2717
2745
|
* Ps = 2 -> steady block.
|
|
2718
2746
|
* Ps = 3 -> blinking underline.
|
|
@@ -2722,31 +2750,37 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
2722
2750
|
*
|
|
2723
2751
|
* @vt: #Y CSI DECSCUSR "Set Cursor Style" "CSI Ps SP q" "Set cursor style."
|
|
2724
2752
|
* Supported cursor styles:
|
|
2725
|
-
* -
|
|
2726
|
-
* -
|
|
2727
|
-
* -
|
|
2728
|
-
* -
|
|
2729
|
-
* -
|
|
2730
|
-
* -
|
|
2753
|
+
* - 0: reset to option
|
|
2754
|
+
* - empty, 1: blinking block
|
|
2755
|
+
* - 2: steady block
|
|
2756
|
+
* - 3: blinking underline
|
|
2757
|
+
* - 4: steady underline
|
|
2758
|
+
* - 5: blinking bar
|
|
2759
|
+
* - 6: steady bar
|
|
2731
2760
|
*/
|
|
2732
2761
|
public setCursorStyle(params: IParams): boolean {
|
|
2733
|
-
const param = params.params[0]
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2762
|
+
const param = params.length === 0 ? 1 : params.params[0];
|
|
2763
|
+
if (param === 0) {
|
|
2764
|
+
this._coreService.decPrivateModes.cursorStyle = undefined;
|
|
2765
|
+
this._coreService.decPrivateModes.cursorBlink = undefined;
|
|
2766
|
+
} else {
|
|
2767
|
+
switch (param) {
|
|
2768
|
+
case 1:
|
|
2769
|
+
case 2:
|
|
2770
|
+
this._coreService.decPrivateModes.cursorStyle = 'block';
|
|
2771
|
+
break;
|
|
2772
|
+
case 3:
|
|
2773
|
+
case 4:
|
|
2774
|
+
this._coreService.decPrivateModes.cursorStyle = 'underline';
|
|
2775
|
+
break;
|
|
2776
|
+
case 5:
|
|
2777
|
+
case 6:
|
|
2778
|
+
this._coreService.decPrivateModes.cursorStyle = 'bar';
|
|
2779
|
+
break;
|
|
2780
|
+
}
|
|
2781
|
+
const isBlinking = param % 2 === 1;
|
|
2782
|
+
this._coreService.decPrivateModes.cursorBlink = isBlinking;
|
|
2747
2783
|
}
|
|
2748
|
-
const isBlinking = param % 2 === 1;
|
|
2749
|
-
this._optionsService.options.cursorBlink = isBlinking;
|
|
2750
2784
|
return true;
|
|
2751
2785
|
}
|
|
2752
2786
|
|
|
@@ -2972,14 +3006,18 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
2972
3006
|
* feedback. Use `OSC 8 ; ; BEL` to finish the current hyperlink.
|
|
2973
3007
|
*/
|
|
2974
3008
|
public setHyperlink(data: string): boolean {
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
3009
|
+
// Arg parsing is special cases to support unencoded semi-colons in the URIs (#4944)
|
|
3010
|
+
const idx = data.indexOf(';');
|
|
3011
|
+
if (idx === -1) {
|
|
3012
|
+
// malformed sequence, just return as handled
|
|
3013
|
+
return true;
|
|
2978
3014
|
}
|
|
2979
|
-
|
|
2980
|
-
|
|
3015
|
+
const id = data.slice(0, idx).trim();
|
|
3016
|
+
const uri = data.slice(idx + 1);
|
|
3017
|
+
if (uri) {
|
|
3018
|
+
return this._createHyperlink(id, uri);
|
|
2981
3019
|
}
|
|
2982
|
-
if (
|
|
3020
|
+
if (id.trim()) {
|
|
2983
3021
|
return false;
|
|
2984
3022
|
}
|
|
2985
3023
|
return this._finishHyperlink();
|
|
@@ -3452,6 +3490,6 @@ class DirtyRowTracker implements IDirtyRowTracker {
|
|
|
3452
3490
|
}
|
|
3453
3491
|
}
|
|
3454
3492
|
|
|
3455
|
-
function isValidColorIndex(value: number): value is ColorIndex {
|
|
3493
|
+
export function isValidColorIndex(value: number): value is ColorIndex {
|
|
3456
3494
|
return 0 <= value && value < 256;
|
|
3457
3495
|
}
|
package/src/common/TaskQueue.ts
CHANGED
|
@@ -74,14 +74,14 @@ abstract class TaskQueue implements ITaskQueue {
|
|
|
74
74
|
let lastDeadlineRemaining = deadline.timeRemaining();
|
|
75
75
|
let deadlineRemaining = 0;
|
|
76
76
|
while (this._i < this._tasks.length) {
|
|
77
|
-
taskDuration =
|
|
77
|
+
taskDuration = performance.now();
|
|
78
78
|
if (!this._tasks[this._i]()) {
|
|
79
79
|
this._i++;
|
|
80
80
|
}
|
|
81
|
-
// other than performance.now,
|
|
82
|
-
// this is not an issue here as a clock change during a short running task is very
|
|
83
|
-
// in case it still happened and leads to negative duration, simply assume 1 msec
|
|
84
|
-
taskDuration = Math.max(1,
|
|
81
|
+
// other than performance.now, performance.now might not be stable (changes on wall clock
|
|
82
|
+
// changes), this is not an issue here as a clock change during a short running task is very
|
|
83
|
+
// unlikely in case it still happened and leads to negative duration, simply assume 1 msec
|
|
84
|
+
taskDuration = Math.max(1, performance.now() - taskDuration);
|
|
85
85
|
longestTask = Math.max(taskDuration, longestTask);
|
|
86
86
|
// Guess the following task will take a similar time to the longest task in this batch, allow
|
|
87
87
|
// additional room to try avoid exceeding the deadline
|
|
@@ -116,9 +116,9 @@ export class PriorityTaskQueue extends TaskQueue {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
private _createDeadline(duration: number): ITaskDeadline {
|
|
119
|
-
const end =
|
|
119
|
+
const end = performance.now() + duration;
|
|
120
120
|
return {
|
|
121
|
-
timeRemaining: () => Math.max(0, end -
|
|
121
|
+
timeRemaining: () => Math.max(0, end - performance.now())
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { IDeleteEvent, IInsertEvent } from 'common/CircularList';
|
|
7
|
-
import { IEvent, IEventEmitter } from 'common/EventEmitter';
|
|
8
7
|
import { Attributes, UnderlineStyle } from 'common/buffer/Constants'; // eslint-disable-line no-unused-vars
|
|
9
8
|
import { IBufferSet } from 'common/buffer/Types';
|
|
10
9
|
import { IParams } from 'common/parser/Types';
|
|
11
10
|
import { ICoreMouseService, ICoreService, IOptionsService, IUnicodeService } from 'common/services/Services';
|
|
12
11
|
import { IFunctionIdentifier, ITerminalOptions as IPublicTerminalOptions } from '@xterm/xterm';
|
|
12
|
+
import type { Emitter, Event } from 'vs/base/common/event';
|
|
13
13
|
|
|
14
14
|
export interface ICoreTerminal {
|
|
15
15
|
coreMouseService: ICoreMouseService;
|
|
@@ -60,12 +60,6 @@ export interface IKeyboardEvent {
|
|
|
60
60
|
|
|
61
61
|
export interface IScrollEvent {
|
|
62
62
|
position: number;
|
|
63
|
-
source: ScrollSource;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const enum ScrollSource {
|
|
67
|
-
TERMINAL,
|
|
68
|
-
VIEWPORT,
|
|
69
63
|
}
|
|
70
64
|
|
|
71
65
|
export interface ICircularList<T> {
|
|
@@ -73,12 +67,12 @@ export interface ICircularList<T> {
|
|
|
73
67
|
maxLength: number;
|
|
74
68
|
isFull: boolean;
|
|
75
69
|
|
|
76
|
-
onDeleteEmitter:
|
|
77
|
-
onDelete:
|
|
78
|
-
onInsertEmitter:
|
|
79
|
-
onInsert:
|
|
80
|
-
onTrimEmitter:
|
|
81
|
-
onTrim:
|
|
70
|
+
onDeleteEmitter: Emitter<IDeleteEvent>;
|
|
71
|
+
onDelete: Event<IDeleteEvent>;
|
|
72
|
+
onInsertEmitter: Emitter<IInsertEvent>;
|
|
73
|
+
onInsert: Event<IInsertEvent>;
|
|
74
|
+
onTrimEmitter: Emitter<number>;
|
|
75
|
+
onTrim: Event<number>;
|
|
82
76
|
|
|
83
77
|
get(index: number): T | undefined;
|
|
84
78
|
set(index: number, value: T): void;
|
|
@@ -264,7 +258,7 @@ export interface IMarker extends IDisposable {
|
|
|
264
258
|
readonly id: number;
|
|
265
259
|
readonly isDisposed: boolean;
|
|
266
260
|
readonly line: number;
|
|
267
|
-
onDispose:
|
|
261
|
+
onDispose: Event<void>;
|
|
268
262
|
}
|
|
269
263
|
export interface IModes {
|
|
270
264
|
insertMode: boolean;
|
|
@@ -274,9 +268,12 @@ export interface IDecPrivateModes {
|
|
|
274
268
|
applicationCursorKeys: boolean;
|
|
275
269
|
applicationKeypad: boolean;
|
|
276
270
|
bracketedPasteMode: boolean;
|
|
271
|
+
cursorBlink: boolean | undefined;
|
|
272
|
+
cursorStyle: CursorStyle | undefined;
|
|
277
273
|
origin: boolean;
|
|
278
274
|
reverseWraparound: boolean;
|
|
279
275
|
sendFocus: boolean;
|
|
276
|
+
synchronizedOutput: boolean;
|
|
280
277
|
wraparound: boolean; // defaults: xterm - true, vt100 - false
|
|
281
278
|
}
|
|
282
279
|
|
|
@@ -425,8 +422,8 @@ type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] exte
|
|
|
425
422
|
: Enumerate<N, [...Acc, Acc['length']]>;
|
|
426
423
|
type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
427
424
|
|
|
428
|
-
type ColorIndex = IntRange<0, 256>; // number from 0 to 255
|
|
429
|
-
type AllColorIndex = ColorIndex | SpecialColorIndex;
|
|
425
|
+
export type ColorIndex = IntRange<0, 256>; // number from 0 to 255
|
|
426
|
+
export type AllColorIndex = ColorIndex | SpecialColorIndex;
|
|
430
427
|
export const enum SpecialColorIndex {
|
|
431
428
|
FOREGROUND = 256,
|
|
432
429
|
BACKGROUND = 257,
|
|
@@ -452,7 +449,7 @@ export type IColorEvent = (IColorReportRequest | IColorSetRequest | IColorRestor
|
|
|
452
449
|
* Calls the parser and handles actions generated by the parser.
|
|
453
450
|
*/
|
|
454
451
|
export interface IInputHandler {
|
|
455
|
-
onTitleChange:
|
|
452
|
+
onTitleChange: Event<string>;
|
|
456
453
|
|
|
457
454
|
parse(data: string | Uint8Array, promiseResult?: boolean): void | Promise<boolean>;
|
|
458
455
|
print(data: Uint32Array, start: number, end: number): void;
|
|
@@ -161,6 +161,10 @@ export class Buffer implements IBuffer {
|
|
|
161
161
|
this.lines.maxLength = newMaxLength;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
// if (this._cols > newCols) {
|
|
165
|
+
// console.log('increase!');
|
|
166
|
+
// }
|
|
167
|
+
|
|
164
168
|
// The following adjustments should only happen if the buffer has been
|
|
165
169
|
// initialized/filled.
|
|
166
170
|
if (this.lines.length > 0) {
|
|
@@ -311,7 +315,8 @@ export class Buffer implements IBuffer {
|
|
|
311
315
|
}
|
|
312
316
|
|
|
313
317
|
private _reflowLarger(newCols: number, newRows: number): void {
|
|
314
|
-
const
|
|
318
|
+
const reflowCursorLine = this._optionsService.rawOptions.reflowCursorLine;
|
|
319
|
+
const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, this._cols, newCols, this.ybase + this.y, this.getNullCell(DEFAULT_ATTR_DATA), reflowCursorLine);
|
|
315
320
|
if (toRemove.length > 0) {
|
|
316
321
|
const newLayoutResult = reflowLargerCreateNewLayout(this.lines, toRemove);
|
|
317
322
|
reflowLargerApplyNewLayout(this.lines, newLayoutResult.layout);
|
|
@@ -343,6 +348,7 @@ export class Buffer implements IBuffer {
|
|
|
343
348
|
}
|
|
344
349
|
|
|
345
350
|
private _reflowSmaller(newCols: number, newRows: number): void {
|
|
351
|
+
const reflowCursorLine = this._optionsService.rawOptions.reflowCursorLine;
|
|
346
352
|
const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);
|
|
347
353
|
// Gather all BufferLines that need to be inserted into the Buffer here so that they can be
|
|
348
354
|
// batched up and only committed once
|
|
@@ -363,11 +369,13 @@ export class Buffer implements IBuffer {
|
|
|
363
369
|
wrappedLines.unshift(nextLine);
|
|
364
370
|
}
|
|
365
371
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
372
|
+
if (!reflowCursorLine) {
|
|
373
|
+
// If these lines contain the cursor don't touch them, the program will handle fixing up
|
|
374
|
+
// wrapped lines with the cursor
|
|
375
|
+
const absoluteY = this.ybase + this.y;
|
|
376
|
+
if (absoluteY >= y && absoluteY < y + wrappedLines.length) {
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
371
379
|
}
|
|
372
380
|
|
|
373
381
|
const lastLineLength = wrappedLines[wrappedLines.length - 1].getTrimmedLength();
|
|
@@ -611,8 +619,8 @@ export class Buffer implements IBuffer {
|
|
|
611
619
|
this._isClearing = true;
|
|
612
620
|
for (let i = 0; i < this.markers.length; i++) {
|
|
613
621
|
this.markers[i].dispose();
|
|
614
|
-
this.markers.splice(i--, 1);
|
|
615
622
|
}
|
|
623
|
+
this.markers.length = 0;
|
|
616
624
|
this._isClearing = false;
|
|
617
625
|
}
|
|
618
626
|
|