Merge pull request #1121 from Tyriar/841_remove_geometry
Remove geometry
This commit is contained in:
@@ -139,7 +139,6 @@ namespace methods_core {
|
|||||||
const r14: number = t.getOption('rows');
|
const r14: number = t.getOption('rows');
|
||||||
const r15: number = t.getOption('tabStopWidth');
|
const r15: number = t.getOption('tabStopWidth');
|
||||||
const r16: number = t.getOption('scrollback');
|
const r16: number = t.getOption('scrollback');
|
||||||
const r17: [number, number] = t.getOption('geometry');
|
|
||||||
const r18: (data: string) => void = t.getOption('handler');
|
const r18: (data: string) => void = t.getOption('handler');
|
||||||
const r19: string = t.getOption('bellSound');
|
const r19: string = t.getOption('bellSound');
|
||||||
const r20: string = t.getOption('bellStyle');
|
const r20: string = t.getOption('bellStyle');
|
||||||
@@ -168,7 +167,6 @@ namespace methods_core {
|
|||||||
t.setOption('rows', 1);
|
t.setOption('rows', 1);
|
||||||
t.setOption('tabStopWidth', 1);
|
t.setOption('tabStopWidth', 1);
|
||||||
t.setOption('scrollback', 1);
|
t.setOption('scrollback', 1);
|
||||||
t.setOption('geometry', [1, 1]);
|
|
||||||
t.setOption('handler', (data: string) => console.log(data));
|
t.setOption('handler', (data: string) => console.log(data));
|
||||||
t.setOption('bellSound', 'foo');
|
t.setOption('bellSound', 'foo');
|
||||||
t.setOption('bellStyle', 'none');
|
t.setOption('bellStyle', 'none');
|
||||||
|
|||||||
@@ -140,7 +140,6 @@ export interface ITerminalOptions {
|
|||||||
enableBold?: boolean;
|
enableBold?: boolean;
|
||||||
fontSize?: number;
|
fontSize?: number;
|
||||||
fontFamily?: string;
|
fontFamily?: string;
|
||||||
geometry?: [number, number];
|
|
||||||
handler?: (data: string) => void;
|
handler?: (data: string) => void;
|
||||||
letterSpacing?: number;
|
letterSpacing?: number;
|
||||||
lineHeight?: number;
|
lineHeight?: number;
|
||||||
|
|||||||
+4
-7
@@ -70,9 +70,10 @@ const WRITE_BUFFER_PAUSE_THRESHOLD = 5;
|
|||||||
const WRITE_BATCH_SIZE = 300;
|
const WRITE_BATCH_SIZE = 300;
|
||||||
|
|
||||||
const DEFAULT_OPTIONS: ITerminalOptions = {
|
const DEFAULT_OPTIONS: ITerminalOptions = {
|
||||||
|
cols: 80,
|
||||||
|
rows: 24,
|
||||||
convertEol: false,
|
convertEol: false,
|
||||||
termName: 'xterm',
|
termName: 'xterm',
|
||||||
geometry: [80, 24],
|
|
||||||
cursorBlink: false,
|
cursorBlink: false,
|
||||||
cursorStyle: 'block',
|
cursorStyle: 'block',
|
||||||
bellSound: BellSound,
|
bellSound: BellSound,
|
||||||
@@ -206,7 +207,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
|||||||
|
|
||||||
public cols: number;
|
public cols: number;
|
||||||
public rows: number;
|
public rows: number;
|
||||||
public geometry: [/*cols*/number, /*rows*/number];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new `Terminal` object.
|
* Creates a new `Terminal` object.
|
||||||
@@ -242,9 +242,8 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
|||||||
// TODO: WHy not document.body?
|
// TODO: WHy not document.body?
|
||||||
this.parent = document ? document.body : null;
|
this.parent = document ? document.body : null;
|
||||||
|
|
||||||
this.cols = this.options.cols || this.options.geometry[0];
|
this.cols = this.options.cols;
|
||||||
this.rows = this.options.rows || this.options.geometry[1];
|
this.rows = this.options.rows;
|
||||||
this.geometry = [this.cols, this.rows];
|
|
||||||
|
|
||||||
if (this.options.handler) {
|
if (this.options.handler) {
|
||||||
this.on('data', this.options.handler);
|
this.on('data', this.options.handler);
|
||||||
@@ -1867,8 +1866,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
|||||||
this.charMeasure.measure(this.options);
|
this.charMeasure.measure(this.options);
|
||||||
|
|
||||||
this.refresh(0, this.rows - 1);
|
this.refresh(0, this.rows - 1);
|
||||||
|
|
||||||
this.geometry = [this.cols, this.rows];
|
|
||||||
this.emit('resize', {cols: x, rows: y});
|
this.emit('resize', {cols: x, rows: y});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-12
@@ -420,11 +420,6 @@ declare module 'xterm' {
|
|||||||
* @param key The option key.
|
* @param key The option key.
|
||||||
*/
|
*/
|
||||||
getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number;
|
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.
|
* Retrieves an option's value from the terminal.
|
||||||
* @param key The option key.
|
* @param key The option key.
|
||||||
@@ -471,13 +466,7 @@ declare module 'xterm' {
|
|||||||
* @param key The option key.
|
* @param key The option key.
|
||||||
* @param value The option value.
|
* @param value The option value.
|
||||||
*/
|
*/
|
||||||
setOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback', value: number): void;
|
setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | '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;
|
|
||||||
/**
|
/**
|
||||||
* Sets an option on the terminal.
|
* Sets an option on the terminal.
|
||||||
* @param key The option key.
|
* @param key The option key.
|
||||||
|
|||||||
Reference in New Issue
Block a user