mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge branch 'master' into issue#2456
This commit is contained in:
@@ -105,9 +105,6 @@ export class GlyphRenderer {
|
||||
const gl = this._gl;
|
||||
|
||||
const program = throwIfFalsy(createProgram(gl, vertexShaderSource, fragmentShaderSource));
|
||||
if (program === undefined) {
|
||||
throw new Error('Could not create WebGL program');
|
||||
}
|
||||
this._program = program;
|
||||
|
||||
// Uniform locations
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IWebGL2RenderingContext } from './Types';
|
||||
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
|
||||
import { RenderModel, COMBINED_CHAR_BIT_MASK } from './RenderModel';
|
||||
import { Disposable } from 'common/Lifecycle';
|
||||
import { DEFAULT_COLOR, CHAR_DATA_CHAR_INDEX, CHAR_DATA_CODE_INDEX, CHAR_DATA_ATTR_INDEX, NULL_CELL_CODE } from 'common/buffer/Constants';
|
||||
import { DEFAULT_COLOR, CHAR_DATA_CHAR_INDEX, CHAR_DATA_CODE_INDEX, NULL_CELL_CODE } from 'common/buffer/Constants';
|
||||
import { Terminal } from 'xterm';
|
||||
import { getLuminance } from './ColorUtils';
|
||||
import { IRenderLayer } from './renderLayer/Types';
|
||||
|
||||
+12
-10
@@ -14,24 +14,26 @@ function startServer() {
|
||||
logs = {};
|
||||
|
||||
app.use('/xterm.css', express.static(__dirname + '/../css/xterm.css'));
|
||||
app.get('/logo.png', (req, res) => res.sendFile(__dirname + '/logo.png'));
|
||||
|
||||
app.get('/', function(req, res){
|
||||
res.sendFile(__dirname + '/index.html');
|
||||
app.get('/logo.png', (req, res) => {
|
||||
res.sendFile(__dirname + '/logo.png'); // lgtm [js/missing-rate-limiting]
|
||||
});
|
||||
|
||||
app.get('/test', function(req, res){
|
||||
res.sendFile(__dirname + '/test.html');
|
||||
app.get('/', (req, res) => {
|
||||
res.sendFile(__dirname + '/index.html'); // lgtm [js/missing-rate-limiting]
|
||||
});
|
||||
|
||||
app.get('/style.css', function(req, res){
|
||||
res.sendFile(__dirname + '/style.css');
|
||||
app.get('/test', (req, res) => {
|
||||
res.sendFile(__dirname + '/test.html'); // lgtm [js/missing-rate-limiting]
|
||||
});
|
||||
|
||||
app.get('/style.css', (req, res) => {
|
||||
res.sendFile(__dirname + '/style.css'); // lgtm [js/missing-rate-limiting]
|
||||
});
|
||||
|
||||
app.use('/dist', express.static(__dirname + '/dist'));
|
||||
app.use('/src', express.static(__dirname + '/src'));
|
||||
|
||||
app.post('/terminals', function (req, res) {
|
||||
app.post('/terminals', (req, res) => {
|
||||
const env = Object.assign({}, process.env);
|
||||
env['COLORTERM'] = 'truecolor';
|
||||
var cols = parseInt(req.query.cols),
|
||||
@@ -55,7 +57,7 @@ function startServer() {
|
||||
res.end();
|
||||
});
|
||||
|
||||
app.post('/terminals/:pid/size', function (req, res) {
|
||||
app.post('/terminals/:pid/size', (req, res) => {
|
||||
var pid = parseInt(req.params.pid),
|
||||
cols = parseInt(req.query.cols),
|
||||
rows = parseInt(req.query.rows),
|
||||
|
||||
@@ -383,18 +383,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
||||
case 'theme':
|
||||
this._setTheme(this.optionsService.options.theme);
|
||||
break;
|
||||
case 'scrollback':
|
||||
const newBufferLength = this.rows + this.optionsService.options.scrollback;
|
||||
if (this.buffer.lines.length > newBufferLength) {
|
||||
const amountToTrim = this.buffer.lines.length - newBufferLength;
|
||||
const needsRefresh = (this.buffer.ydisp - amountToTrim < 0);
|
||||
this.buffer.lines.trimStart(amountToTrim);
|
||||
this.buffer.ybase = Math.max(this.buffer.ybase - amountToTrim, 0);
|
||||
this.buffer.ydisp = Math.max(this.buffer.ydisp - amountToTrim, 0);
|
||||
if (needsRefresh) {
|
||||
this.refresh(0, this.rows - 1);
|
||||
}
|
||||
}
|
||||
case 'windowsMode':
|
||||
if (this.optionsService.options.windowsMode) {
|
||||
if (!this._windowsMode) {
|
||||
|
||||
@@ -303,7 +303,6 @@ export class CharacterJoinerRegistry implements ICharacterJoinerRegistry {
|
||||
// current range
|
||||
ranges[i - 1][1] = Math.max(newRange[1], range[1]);
|
||||
ranges.splice(i, 1);
|
||||
inRange = false;
|
||||
return ranges;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
|
||||
import { AttributeData } from 'common/buffer/AttributeData';
|
||||
import { NULL_CELL_CODE, WHITESPACE_CELL_CHAR } from 'common/buffer/Constants';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { ITerminalOptions, IOptionsService } from 'common/services/Services';
|
||||
import { IOptionsService } from 'common/services/Services';
|
||||
|
||||
export const BOLD_CLASS = 'xterm-bold';
|
||||
export const DIM_CLASS = 'xterm-dim';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { CharData, IBufferLine, ICellData } from 'common/Types';
|
||||
import { stringFromCodePoint } from 'common/input/TextDecoder';
|
||||
import { DEFAULT_COLOR, CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Content } from 'common/buffer/Constants';
|
||||
import { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Content } from 'common/buffer/Constants';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { AttributeData } from 'common/buffer/AttributeData';
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ export class Terminal implements ITerminalApi {
|
||||
|
||||
private _verifyIntegers(...values: number[]): void {
|
||||
values.forEach(value => {
|
||||
if (value === Infinity || value === NaN || value % 1 !== 0) {
|
||||
if (value === Infinity || isNaN(value) || value % 1 !== 0) {
|
||||
throw new Error('This API only accepts integers');
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -860,7 +860,7 @@ declare module 'xterm' {
|
||||
/**
|
||||
* An object representing a range within the viewport of the terminal.
|
||||
*/
|
||||
interface IViewportRange {
|
||||
export interface IViewportRange {
|
||||
/**
|
||||
* The start cell of the range.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user