Merge branch 'master' into underline-dotted

This commit is contained in:
YAYA 刘玉婷
2023-09-01 14:12:01 +08:00
committed by GitHub
31 changed files with 226 additions and 1046 deletions
+5 -11
View File
@@ -21,7 +21,7 @@
* http://linux.die.net/man/7/urxvt
*/
import { Disposable, toDisposable } from 'common/Lifecycle';
import { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
import { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, ICoreMouseService, IUnicodeService, LogLevelEnum, ITerminalOptions, IOscLinkService } from 'common/services/Services';
import { InstantiationService } from 'common/services/InstantiationService';
import { LogService } from 'common/services/LogService';
@@ -57,7 +57,7 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
protected _inputHandler: InputHandler;
private _writeBuffer: WriteBuffer;
private _windowsWrappingHeuristics: IDisposable | undefined;
private _windowsWrappingHeuristics = this.register(new MutableDisposable());
private readonly _onBinary = this.register(new EventEmitter<string>());
public readonly onBinary = this._onBinary.event;
@@ -144,11 +144,6 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
// Setup WriteBuffer
this._writeBuffer = this.register(new WriteBuffer((data, promiseResult) => this._inputHandler.parse(data, promiseResult)));
this.register(forwardEvent(this._writeBuffer.onWriteParsed, this._onWriteParsed));
this.register(toDisposable(() => {
this._windowsWrappingHeuristics?.dispose();
this._windowsWrappingHeuristics = undefined;
}));
}
public write(data: string | Uint8Array, callback?: () => void): void {
@@ -267,20 +262,19 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
if (value) {
this._enableWindowsWrappingHeuristics();
} else {
this._windowsWrappingHeuristics?.dispose();
this._windowsWrappingHeuristics = undefined;
this._windowsWrappingHeuristics.clear();
}
}
protected _enableWindowsWrappingHeuristics(): void {
if (!this._windowsWrappingHeuristics) {
if (!this._windowsWrappingHeuristics.value) {
const disposables: IDisposable[] = [];
disposables.push(this.onLineFeed(updateWindowsModeWrappedState.bind(null, this._bufferService)));
disposables.push(this.registerCsiHandler({ final: 'H' }, () => {
updateWindowsModeWrappedState(this._bufferService);
return false;
}));
this._windowsWrappingHeuristics = toDisposable(() => {
this._windowsWrappingHeuristics.value = toDisposable(() => {
for (const d of disposables) {
d.dispose();
}
-3
View File
@@ -13,9 +13,6 @@ export abstract class Disposable implements IDisposable {
protected _disposables: IDisposable[] = [];
protected _isDisposed: boolean = false;
constructor() {
}
/**
* Disposes the object, triggering the `dispose` method on all registered IDisposables.
*/
-3
View File
@@ -14,9 +14,6 @@ export interface ILoadedAddon {
export class AddonManager implements IDisposable {
protected _addons: ILoadedAddon[] = [];
constructor() {
}
public dispose(): void {
for (let i = this._addons.length - 1; i >= 0; i--) {
this._addons[i].instance.dispose();