Remove geometry

Fixes #841
This commit is contained in:
Daniel Imms
2017-11-09 10:02:28 -08:00
parent b798463d27
commit 0b90feab1e
4 changed files with 5 additions and 22 deletions
-2
View File
@@ -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');
-1
View File
@@ -138,7 +138,6 @@ export interface ITerminalOptions {
enableBold?: boolean;
fontSize?: number;
fontFamily?: string;
geometry?: [number, number];
handler?: (data: string) => void;
letterSpacing?: number;
lineHeight?: number;
+4 -7
View File
@@ -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});
}
+1 -12
View File
@@ -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.