Merge branch 'master' into issue#2456
This commit is contained in:
@@ -105,9 +105,6 @@ export class GlyphRenderer {
|
|||||||
const gl = this._gl;
|
const gl = this._gl;
|
||||||
|
|
||||||
const program = throwIfFalsy(createProgram(gl, vertexShaderSource, fragmentShaderSource));
|
const program = throwIfFalsy(createProgram(gl, vertexShaderSource, fragmentShaderSource));
|
||||||
if (program === undefined) {
|
|
||||||
throw new Error('Could not create WebGL program');
|
|
||||||
}
|
|
||||||
this._program = program;
|
this._program = program;
|
||||||
|
|
||||||
// Uniform locations
|
// Uniform locations
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { IWebGL2RenderingContext } from './Types';
|
|||||||
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
|
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
|
||||||
import { RenderModel, COMBINED_CHAR_BIT_MASK } from './RenderModel';
|
import { RenderModel, COMBINED_CHAR_BIT_MASK } from './RenderModel';
|
||||||
import { Disposable } from 'common/Lifecycle';
|
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 { Terminal } from 'xterm';
|
||||||
import { getLuminance } from './ColorUtils';
|
import { getLuminance } from './ColorUtils';
|
||||||
import { IRenderLayer } from './renderLayer/Types';
|
import { IRenderLayer } from './renderLayer/Types';
|
||||||
|
|||||||
+12
-10
@@ -14,24 +14,26 @@ function startServer() {
|
|||||||
logs = {};
|
logs = {};
|
||||||
|
|
||||||
app.use('/xterm.css', express.static(__dirname + '/../css/xterm.css'));
|
app.use('/xterm.css', express.static(__dirname + '/../css/xterm.css'));
|
||||||
app.get('/logo.png', (req, res) => res.sendFile(__dirname + '/logo.png'));
|
app.get('/logo.png', (req, res) => {
|
||||||
|
res.sendFile(__dirname + '/logo.png'); // lgtm [js/missing-rate-limiting]
|
||||||
app.get('/', function(req, res){
|
|
||||||
res.sendFile(__dirname + '/index.html');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/test', function(req, res){
|
app.get('/', (req, res) => {
|
||||||
res.sendFile(__dirname + '/test.html');
|
res.sendFile(__dirname + '/index.html'); // lgtm [js/missing-rate-limiting]
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/style.css', function(req, res){
|
app.get('/test', (req, res) => {
|
||||||
res.sendFile(__dirname + '/style.css');
|
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('/dist', express.static(__dirname + '/dist'));
|
||||||
app.use('/src', express.static(__dirname + '/src'));
|
app.use('/src', express.static(__dirname + '/src'));
|
||||||
|
|
||||||
app.post('/terminals', function (req, res) {
|
app.post('/terminals', (req, res) => {
|
||||||
const env = Object.assign({}, process.env);
|
const env = Object.assign({}, process.env);
|
||||||
env['COLORTERM'] = 'truecolor';
|
env['COLORTERM'] = 'truecolor';
|
||||||
var cols = parseInt(req.query.cols),
|
var cols = parseInt(req.query.cols),
|
||||||
@@ -55,7 +57,7 @@ function startServer() {
|
|||||||
res.end();
|
res.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/terminals/:pid/size', function (req, res) {
|
app.post('/terminals/:pid/size', (req, res) => {
|
||||||
var pid = parseInt(req.params.pid),
|
var pid = parseInt(req.params.pid),
|
||||||
cols = parseInt(req.query.cols),
|
cols = parseInt(req.query.cols),
|
||||||
rows = parseInt(req.query.rows),
|
rows = parseInt(req.query.rows),
|
||||||
|
|||||||
@@ -383,18 +383,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
case 'theme':
|
case 'theme':
|
||||||
this._setTheme(this.optionsService.options.theme);
|
this._setTheme(this.optionsService.options.theme);
|
||||||
break;
|
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':
|
case 'windowsMode':
|
||||||
if (this.optionsService.options.windowsMode) {
|
if (this.optionsService.options.windowsMode) {
|
||||||
if (!this._windowsMode) {
|
if (!this._windowsMode) {
|
||||||
|
|||||||
@@ -303,7 +303,6 @@ export class CharacterJoinerRegistry implements ICharacterJoinerRegistry {
|
|||||||
// current range
|
// current range
|
||||||
ranges[i - 1][1] = Math.max(newRange[1], range[1]);
|
ranges[i - 1][1] = Math.max(newRange[1], range[1]);
|
||||||
ranges.splice(i, 1);
|
ranges.splice(i, 1);
|
||||||
inRange = false;
|
|
||||||
return ranges;
|
return ranges;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
|
|||||||
import { AttributeData } from 'common/buffer/AttributeData';
|
import { AttributeData } from 'common/buffer/AttributeData';
|
||||||
import { NULL_CELL_CODE, WHITESPACE_CELL_CHAR } from 'common/buffer/Constants';
|
import { NULL_CELL_CODE, WHITESPACE_CELL_CHAR } from 'common/buffer/Constants';
|
||||||
import { CellData } from 'common/buffer/CellData';
|
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 BOLD_CLASS = 'xterm-bold';
|
||||||
export const DIM_CLASS = 'xterm-dim';
|
export const DIM_CLASS = 'xterm-dim';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import { CharData, IBufferLine, ICellData } from 'common/Types';
|
import { CharData, IBufferLine, ICellData } from 'common/Types';
|
||||||
import { stringFromCodePoint } from 'common/input/TextDecoder';
|
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 { CellData } from 'common/buffer/CellData';
|
||||||
import { AttributeData } from 'common/buffer/AttributeData';
|
import { AttributeData } from 'common/buffer/AttributeData';
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ export class Terminal implements ITerminalApi {
|
|||||||
|
|
||||||
private _verifyIntegers(...values: number[]): void {
|
private _verifyIntegers(...values: number[]): void {
|
||||||
values.forEach(value => {
|
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');
|
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.
|
* An object representing a range within the viewport of the terminal.
|
||||||
*/
|
*/
|
||||||
interface IViewportRange {
|
export interface IViewportRange {
|
||||||
/**
|
/**
|
||||||
* The start cell of the range.
|
* The start cell of the range.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user