mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
@@ -54,7 +54,7 @@ export function enableLigatures(term: Terminal): void {
|
||||
|
||||
// Only refresh things if we actually found a font
|
||||
if (f) {
|
||||
term.refresh(0, term.options.rows! - 1);
|
||||
term.refresh(0, term.rows - 1);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as playwright from 'playwright';
|
||||
import deepEqual = require('deep-equal');
|
||||
import { ITerminalOptions } from 'xterm';
|
||||
import { ITerminalInitOnlyOptions, ITerminalOptions } from 'xterm';
|
||||
import { deepStrictEqual, fail } from 'assert';
|
||||
|
||||
export async function pollFor<T>(page: playwright.Page, evalOrFn: string | (() => Promise<T>), val: T, preFn?: () => Promise<void>, maxDuration?: number): Promise<void> {
|
||||
@@ -43,7 +43,7 @@ export async function timeout(ms: number): Promise<void> {
|
||||
return new Promise<void>(r => setTimeout(r, ms));
|
||||
}
|
||||
|
||||
export async function openTerminal(page: playwright.Page, options: ITerminalOptions = {}): Promise<void> {
|
||||
export async function openTerminal(page: playwright.Page, options: ITerminalOptions & ITerminalInitOnlyOptions = {}): Promise<void> {
|
||||
await page.evaluate(`window.term = new Terminal(${JSON.stringify({ allowProposedApi: true, ...options })})`);
|
||||
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
|
||||
await page.waitForSelector('.xterm-rows');
|
||||
|
||||
Vendored
+18
-12
@@ -21,7 +21,7 @@ declare module 'xterm' {
|
||||
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';
|
||||
|
||||
/**
|
||||
* An object containing start up options for the terminal.
|
||||
* An object containing options for the terminal.
|
||||
*/
|
||||
export interface ITerminalOptions {
|
||||
/**
|
||||
@@ -55,11 +55,6 @@ declare module 'xterm' {
|
||||
*/
|
||||
convertEol?: boolean;
|
||||
|
||||
/**
|
||||
* The number of columns in the terminal.
|
||||
*/
|
||||
cols?: number;
|
||||
|
||||
/**
|
||||
* Whether the cursor blinks.
|
||||
*/
|
||||
@@ -177,11 +172,6 @@ declare module 'xterm' {
|
||||
*/
|
||||
rightClickSelectsWord?: boolean;
|
||||
|
||||
/**
|
||||
* The number of rows in the terminal.
|
||||
*/
|
||||
rows?: number;
|
||||
|
||||
/**
|
||||
* Whether screen reader support is enabled. When on this will expose
|
||||
* supporting elements in the DOM to support NVDA on Windows and VoiceOver
|
||||
@@ -248,6 +238,22 @@ declare module 'xterm' {
|
||||
overviewRulerWidth?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object containing additional options for the terminal that can only be
|
||||
* set on start up.
|
||||
*/
|
||||
export interface ITerminalInitOnlyOptions {
|
||||
/**
|
||||
* The number of columns in the terminal.
|
||||
*/
|
||||
cols?: number;
|
||||
|
||||
/**
|
||||
* The number of rows in the terminal.
|
||||
*/
|
||||
rows?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains colors to theme the terminal with.
|
||||
*/
|
||||
@@ -714,7 +720,7 @@ declare module 'xterm' {
|
||||
*
|
||||
* @param options An object containing a set of options.
|
||||
*/
|
||||
constructor(options?: ITerminalOptions);
|
||||
constructor(options?: ITerminalOptions & ITerminalInitOnlyOptions);
|
||||
|
||||
/**
|
||||
* Adds an event listener for when the bell is triggered.
|
||||
|
||||
Reference in New Issue
Block a user