From 5170a12cb1ff66c55557159eff0e8655c63111a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Fri, 19 Mar 2021 01:07:43 +0100 Subject: [PATCH] silence writeSync warning --- src/common/CoreTerminal.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/CoreTerminal.ts b/src/common/CoreTerminal.ts index 50be0d7c..a8961451 100644 --- a/src/common/CoreTerminal.ts +++ b/src/common/CoreTerminal.ts @@ -22,7 +22,7 @@ */ import { Disposable } from 'common/Lifecycle'; -import { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, ICoreMouseService, IUnicodeService, IDirtyRowService } from 'common/services/Services'; +import { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, ICoreMouseService, IUnicodeService, IDirtyRowService, LogLevelEnum } from 'common/services/Services'; import { InstantiationService } from 'common/services/InstantiationService'; import { LogService } from 'common/services/LogService'; import { BufferService, MINIMUM_COLS, MINIMUM_ROWS } from 'common/services/BufferService'; @@ -135,9 +135,13 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal { * @deprecated Unreliable, will be removed soon. */ public writeSync(data: string | Uint8Array): void { - console.error('writeSync is unreliable and will be removed soon.'); + if (this._logService.logLevel <= LogLevelEnum.WARN && !this._hasBeenWarnedOnce) { + this._logService.warn('writeSync is unreliable and will be removed soon.'); + this._hasBeenWarnedOnce = true; + } this._writeBuffer.writeSync(data); } + private _hasBeenWarnedOnce = false; public resize(x: number, y: number): void { if (isNaN(x) || isNaN(y)) {