fix test and replace options with rawOptions

This commit is contained in:
Simon Lamon
2022-01-08 08:20:50 +00:00
parent 65182176b9
commit 1dcc1d1baf
21 changed files with 84 additions and 79 deletions
+2 -2
View File
@@ -36,8 +36,8 @@ export class BufferService extends Disposable implements IBufferService {
@IOptionsService private _optionsService: IOptionsService
) {
super();
this.cols = Math.max(_optionsService.options.cols || 0, MINIMUM_COLS);
this.rows = Math.max(_optionsService.options.rows || 0, MINIMUM_ROWS);
this.cols = Math.max(_optionsService.rawOptions.cols || 0, MINIMUM_COLS);
this.rows = Math.max(_optionsService.rawOptions.rows || 0, MINIMUM_ROWS);
this.buffers = new BufferSet(_optionsService, this);
}
+2 -2
View File
@@ -62,7 +62,7 @@ export class CoreService extends Disposable implements ICoreService {
public triggerDataEvent(data: string, wasUserInput: boolean = false): void {
// Prevents all events to pty process if stdin is disabled
if (this._optionsService.options.disableStdin) {
if (this._optionsService.rawOptions.disableStdin) {
return;
}
@@ -83,7 +83,7 @@ export class CoreService extends Disposable implements ICoreService {
}
public triggerBinaryEvent(data: string): void {
if (this._optionsService.options.disableStdin) {
if (this._optionsService.rawOptions.disableStdin) {
return;
}
this._logService.debug(`sending binary "${data}"`, () => data.split('').map(e => e.charCodeAt(0)));
+1 -1
View File
@@ -46,7 +46,7 @@ export class LogService implements ILogService {
}
private _updateLogLevel(): void {
this.logLevel = optionsKeyToLogLevel[this._optionsService.options.logLevel];
this.logLevel = optionsKeyToLogLevel[this._optionsService.rawOptions.logLevel];
}
private _evalLazyOptionalParams(optionalParams: any[]): void {
+5
View File
@@ -188,6 +188,11 @@ export const IOptionsService = createDecorator<IOptionsService>('OptionsService'
export interface IOptionsService {
serviceBrand: undefined;
/**
* Read only access to the raw options object, this is an internal-only fast path for accessing
* single options without any validation as we trust TypeScript to enforce correct usage
* internally.
*/
readonly rawOptions: Readonly<ITerminalOptions>;
readonly options: ITerminalOptions;