mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
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 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');
|
||||
|
||||
@@ -140,7 +140,6 @@ export interface ITerminalOptions {
|
||||
enableBold?: boolean;
|
||||
fontSize?: number;
|
||||
fontFamily?: string;
|
||||
geometry?: [number, number];
|
||||
handler?: (data: string) => void;
|
||||
letterSpacing?: number;
|
||||
lineHeight?: number;
|
||||
|
||||
+4
-7
@@ -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,
|
||||
@@ -206,7 +207,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.
|
||||
@@ -242,9 +242,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);
|
||||
@@ -1867,8 +1866,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});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-12
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user