windowOptions on ctor options
This commit is contained in:
@@ -7,7 +7,7 @@ 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 } from 'common/WindowOptions';
|
||||
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
|
||||
@@ -53,7 +53,7 @@ export const DEFAULT_OPTIONS: ITerminalOptions = Object.freeze({
|
||||
cancelEvents: false,
|
||||
useFlowControl: false,
|
||||
wordSeparator: ' ()[]{}\',:;"',
|
||||
windowOptions: 0
|
||||
windowOptions: {}
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -65,6 +65,7 @@ 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; }
|
||||
@@ -77,6 +78,9 @@ 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 {
|
||||
@@ -132,7 +136,7 @@ export class OptionsService implements IOptionsService {
|
||||
}
|
||||
break;
|
||||
case 'windowOptions':
|
||||
value = setWindowOptions(value, this.options.windowOptions);
|
||||
this.windowOptions = setWindowOptions(value, this.windowOptions);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -142,7 +146,7 @@ export class OptionsService implements IOptionsService {
|
||||
throw new Error(`No option with key "${key}"`);
|
||||
}
|
||||
if (key === 'windowOptions') {
|
||||
return getWindowOptions(this.options.windowOptions);
|
||||
return getWindowOptions(this.windowOptions);
|
||||
}
|
||||
return this.options[key];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user