Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions addons/xterm-addon-webgl/src/GlyphRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion addons/xterm-addon-webgl/src/WebglRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
20 changes: 11 additions & 9 deletions demo/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('/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('/', (req, res) => {
res.sendFile(__dirname + '/index.html'); // lgtm [js/missing-rate-limiting]
});

app.get('/test', function(req, res){
res.sendFile(__dirname + '/test.html');
app.get('/test', (req, res) => {
res.sendFile(__dirname + '/test.html'); // lgtm [js/missing-rate-limiting]
});

app.get('/style.css', function(req, res){
res.sendFile(__dirname + '/style.css');
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),
Expand All @@ -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),
Expand Down
12 changes: 0 additions & 12 deletions src/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion src/browser/renderer/CharacterJoinerRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/browser/renderer/dom/DomRendererRowFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/common/buffer/BufferLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/public/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});
Expand Down