diff --git a/fixtures/typings-test/typings-test.ts b/fixtures/typings-test/typings-test.ts index 93fd501f..887eb322 100644 --- a/fixtures/typings-test/typings-test.ts +++ b/fixtures/typings-test/typings-test.ts @@ -139,7 +139,6 @@ namespace methods_core { const r14: number = t.getOption('rows'); const r15: number = t.getOption('tabStopWidth'); const r16: number = t.getOption('scrollback'); - const r17: [number, number] = t.getOption('geometry'); const r18: (data: string) => void = t.getOption('handler'); const r19: string = t.getOption('bellSound'); const r20: string = t.getOption('bellStyle'); @@ -168,7 +167,6 @@ namespace methods_core { t.setOption('rows', 1); t.setOption('tabStopWidth', 1); t.setOption('scrollback', 1); - t.setOption('geometry', [1, 1]); t.setOption('handler', (data: string) => console.log(data)); t.setOption('bellSound', 'foo'); t.setOption('bellStyle', 'none'); diff --git a/src/Interfaces.ts b/src/Interfaces.ts index e98385c1..086bf40d 100644 --- a/src/Interfaces.ts +++ b/src/Interfaces.ts @@ -138,7 +138,6 @@ export interface ITerminalOptions { enableBold?: boolean; fontSize?: number; fontFamily?: string; - geometry?: [number, number]; handler?: (data: string) => void; letterSpacing?: number; lineHeight?: number; diff --git a/src/Terminal.ts b/src/Terminal.ts index 5ac8a1a0..175805aa 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -70,9 +70,10 @@ const WRITE_BUFFER_PAUSE_THRESHOLD = 5; const WRITE_BATCH_SIZE = 300; const DEFAULT_OPTIONS: ITerminalOptions = { + cols: 80, + rows: 24, convertEol: false, termName: 'xterm', - geometry: [80, 24], cursorBlink: false, cursorStyle: 'block', bellSound: BellSound, @@ -205,7 +206,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT public cols: number; public rows: number; - public geometry: [/*cols*/number, /*rows*/number]; /** * Creates a new `Terminal` object. @@ -241,9 +241,8 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT // TODO: WHy not document.body? this.parent = document ? document.body : null; - this.cols = this.options.cols || this.options.geometry[0]; - this.rows = this.options.rows || this.options.geometry[1]; - this.geometry = [this.cols, this.rows]; + this.cols = this.options.cols; + this.rows = this.options.rows; if (this.options.handler) { this.on('data', this.options.handler); @@ -1865,8 +1864,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT this.charMeasure.measure(this.options); this.refresh(0, this.rows - 1); - - this.geometry = [this.cols, this.rows]; this.emit('resize', {cols: x, rows: y}); } diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index b0f5ac4d..43be69c2 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -420,11 +420,6 @@ declare module 'xterm' { * @param key The option key. */ getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; - /** - * Retrieves an option's value from the terminal. - * @param key The option key. - */ - getOption(key: 'geometry'): [number, number]; /** * Retrieves an option's value from the terminal. * @param key The option key. @@ -471,13 +466,7 @@ declare module 'xterm' { * @param key The option key. * @param value The option value. */ - setOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback', value: number): void; - /** - * Sets an option on the terminal. - * @param key The option key. - * @param value The option value. - */ - setOption(key: 'geometry', value: [number, number]): void; + setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void; /** * Sets an option on the terminal. * @param key The option key.