simplify options

This commit is contained in:
Jörg Breitbart
2019-11-14 12:59:48 +01:00
parent 45d1139ab0
commit 8991ed8270
4 changed files with 38 additions and 111 deletions
-10
View File
@@ -7,7 +7,6 @@ import { IOptionsService, ITerminalOptions, IPartialTerminalOptions } from 'comm
import { EventEmitter, IEvent } from 'common/EventEmitter';
import { isMac } from 'common/Platform';
import { clone } from 'common/Clone';
import { setWindowOptions, getWindowOptions, WindowOptions } from 'common/WindowOptions';
// Source: https://freesound.org/people/altemark/sounds/45759/
// This sound is released under the Creative Commons Attribution 3.0 Unported
@@ -65,7 +64,6 @@ export class OptionsService implements IOptionsService {
serviceBrand: any;
public options: ITerminalOptions;
public windowOptions: WindowOptions = 0;
private _onOptionChange = new EventEmitter<string>();
public get onOptionChange(): IEvent<string> { return this._onOptionChange.event; }
@@ -78,9 +76,6 @@ export class OptionsService implements IOptionsService {
this.options[k] = newValue;
}
});
if (options.windowOptions) {
this.windowOptions = setWindowOptions(options.windowOptions as any, 0);
}
}
public setOption(key: string, value: any): void {
@@ -135,8 +130,6 @@ export class OptionsService implements IOptionsService {
throw new Error(`${key} cannot be less than or equal to 0, value: ${value}`);
}
break;
case 'windowOptions':
this.windowOptions = setWindowOptions(value, this.windowOptions);
}
return value;
}
@@ -145,9 +138,6 @@ export class OptionsService implements IOptionsService {
if (!(key in DEFAULT_OPTIONS)) {
throw new Error(`No option with key "${key}"`);
}
if (key === 'windowOptions') {
return getWindowOptions(this.windowOptions);
}
return this.options[key];
}
}
-2
View File
@@ -7,7 +7,6 @@ import { IEvent } from 'common/EventEmitter';
import { IBuffer, IBufferSet } from 'common/buffer/Types';
import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEncoding, ICoreMouseProtocol, CoreMouseEventType, IWindowOptions } from 'common/Types';
import { createDecorator } from 'common/services/ServiceRegistry';
import { WindowOptions } from 'common/WindowOptions';
export const IBufferService = createDecorator<IBufferService>('BufferService');
export interface IBufferService {
@@ -167,7 +166,6 @@ export interface IOptionsService {
serviceBrand: any;
readonly options: ITerminalOptions;
readonly windowOptions: WindowOptions;
readonly onOptionChange: IEvent<string>;