Merge branch 'master' into 1341_memory_leak
This commit is contained in:
@@ -15,6 +15,7 @@ build/
|
|||||||
.vscode/
|
.vscode/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
fixtures/typings-test/*.js
|
fixtures/typings-test/*.js
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
# Directories needed for code coverage
|
# Directories needed for code coverage
|
||||||
/coverage/
|
/coverage/
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Aleksandr Andrienko <aandrienko@codenvy.com>
|
|||||||
Aleksandr Andriienko <oandriie@redhat.com>
|
Aleksandr Andriienko <oandriie@redhat.com>
|
||||||
Alessandro Nadalin <alessandro.nadalin@gmail.com>
|
Alessandro Nadalin <alessandro.nadalin@gmail.com>
|
||||||
Alexander Olsson <noseglid@gmail.com>
|
Alexander Olsson <noseglid@gmail.com>
|
||||||
|
Alexandre Petit-Pas <petitpasalexandre@gmail.com>
|
||||||
Alexey Kontsevoy <alexey@gravitational.com>
|
Alexey Kontsevoy <alexey@gravitational.com>
|
||||||
Andres Mejia <amejia004@gmail.com>
|
Andres Mejia <amejia004@gmail.com>
|
||||||
Anish Athalye <me@anishathalye.com>
|
Anish Athalye <me@anishathalye.com>
|
||||||
@@ -18,6 +19,7 @@ Austin Robertson <austinrobertson@gmail.com>
|
|||||||
ayapi <colors.aya@gmail.com>
|
ayapi <colors.aya@gmail.com>
|
||||||
Ben Hall <ben@benhall.me.uk>
|
Ben Hall <ben@benhall.me.uk>
|
||||||
Benjamin Fischer <benjamin.fischer@rwth-aachen.de>
|
Benjamin Fischer <benjamin.fischer@rwth-aachen.de>
|
||||||
|
Benjamin Woodruff <github@benjam.info>
|
||||||
Bill Church <billchurch@users.noreply.github.com>
|
Bill Church <billchurch@users.noreply.github.com>
|
||||||
Bob Reid <bobreid@Bobs-MacBook-Pro.local>
|
Bob Reid <bobreid@Bobs-MacBook-Pro.local>
|
||||||
bottleofwater <nison.mael+bottleofwater@gmail.com>
|
bottleofwater <nison.mael+bottleofwater@gmail.com>
|
||||||
@@ -44,6 +46,7 @@ Edgar Andrés Margffoy Tuay <andfoy@gmail.com>
|
|||||||
Elliot Saba <staticfloat@gmail.com>
|
Elliot Saba <staticfloat@gmail.com>
|
||||||
Exile <exile@chamber.ee>
|
Exile <exile@chamber.ee>
|
||||||
Felipe Gasper <felipe@felipegasper.com>
|
Felipe Gasper <felipe@felipegasper.com>
|
||||||
|
Felix <30559812+felixse@users.noreply.github.com>
|
||||||
ficristo <ficristo.work@gmail.com>
|
ficristo <ficristo.work@gmail.com>
|
||||||
Gary Ritchie <gary@rstudio.com>
|
Gary Ritchie <gary@rstudio.com>
|
||||||
hiro-su <h.sugipon@gmail.com>
|
hiro-su <h.sugipon@gmail.com>
|
||||||
@@ -70,6 +73,7 @@ Lucian Buzzo <lucian.buzzo@gmail.com>
|
|||||||
Lukas Drgon <lukas.drgon@gmail.com>
|
Lukas Drgon <lukas.drgon@gmail.com>
|
||||||
Maël Nison <nison.mael@gmail.com>
|
Maël Nison <nison.mael@gmail.com>
|
||||||
Marc Dumais <marc.dumais@ericsson.com>
|
Marc Dumais <marc.dumais@ericsson.com>
|
||||||
|
Marek Libra <mlibra@redhat.com>
|
||||||
Markus F.X.J. Oberhumer <markus@oberhumer.com>
|
Markus F.X.J. Oberhumer <markus@oberhumer.com>
|
||||||
Martin Chloride <i@martincl2.me>
|
Martin Chloride <i@martincl2.me>
|
||||||
Martin Koppehel <martin.koppehel@st.ovgu.de>
|
Martin Koppehel <martin.koppehel@st.ovgu.de>
|
||||||
@@ -85,6 +89,7 @@ Oleksandr Andriienko <oandriie@redhat.com>
|
|||||||
Paris Kasidiaris <pariskasidiaris@gmail.com>
|
Paris Kasidiaris <pariskasidiaris@gmail.com>
|
||||||
Paris Kasidiaris <paris@sourcelair.com>
|
Paris Kasidiaris <paris@sourcelair.com>
|
||||||
Peter Baumgarten <me@peterbaumgarten.com>
|
Peter Baumgarten <me@peterbaumgarten.com>
|
||||||
|
Philip Olson <philip.olson@protonmail.ch>
|
||||||
Rick Baker <rick@ricktbaker.com>
|
Rick Baker <rick@ricktbaker.com>
|
||||||
runarberg <runar@greenqloud.com>
|
runarberg <runar@greenqloud.com>
|
||||||
Saad Malik <simfox3@gmail.com>
|
Saad Malik <simfox3@gmail.com>
|
||||||
|
|||||||
@@ -76,6 +76,12 @@ var xterm = new Terminal(); // Instantiate the terminal
|
|||||||
xterm.fit(); // Use the `fit` method, provided by the `fit` addon
|
xterm.fit(); // Use the `fit` method, provided by the `fit` addon
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Third party addons
|
||||||
|
|
||||||
|
There are also the following third party addons available:
|
||||||
|
|
||||||
|
- [xterm-webfont](https://www.npmjs.com/package/xterm-webfont)
|
||||||
|
|
||||||
## Browser Support
|
## Browser Support
|
||||||
|
|
||||||
Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Here is a list of the versions we aim to support:
|
Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Here is a list of the versions we aim to support:
|
||||||
@@ -128,6 +134,7 @@ computational environment for Jupyter, supporting interactive data science and s
|
|||||||
- [**Microsoft SQL Operations Studio**](https://github.com/Microsoft/sqlopsstudio): A data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux
|
- [**Microsoft SQL Operations Studio**](https://github.com/Microsoft/sqlopsstudio): A data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux
|
||||||
- [**FreeMAN**](https://github.com/matthew-matvei/freeman): A free, cross-platform file manager for power users
|
- [**FreeMAN**](https://github.com/matthew-matvei/freeman): A free, cross-platform file manager for power users
|
||||||
- [**Fluent Terminal**](https://github.com/felixse/FluentTerminal): A terminal emulator based on UWP and web technologies.
|
- [**Fluent Terminal**](https://github.com/felixse/FluentTerminal): A terminal emulator based on UWP and web technologies.
|
||||||
|
- [**Hyper**](https://hyper.is): A terminal built on web technologies
|
||||||
|
|
||||||
Do you use xterm.js in your application as well? Please [open a Pull Request](https://github.com/sourcelair/xterm.js/pulls) to include it here. We would love to have it in our list.
|
Do you use xterm.js in your application as well? Please [open a Pull Request](https://github.com/sourcelair/xterm.js/pulls) to include it here. We would love to have it in our list.
|
||||||
|
|
||||||
|
|||||||
@@ -7,16 +7,16 @@ var pty = require('node-pty');
|
|||||||
var terminals = {},
|
var terminals = {},
|
||||||
logs = {};
|
logs = {};
|
||||||
|
|
||||||
app.use('/build', express.static(__dirname + '/../../../../build'));
|
app.use('/build', express.static(__dirname + '/../../build'));
|
||||||
app.use('/demo', express.static(__dirname + '/../../../../demo'));
|
app.use('/demo', express.static(__dirname + '/../../demo'));
|
||||||
app.use('/zmodemjs', express.static(__dirname + '/../../../../node_modules/zmodem.js/dist'));
|
app.use('/zmodemjs', express.static(__dirname + '/../../node_modules/zmodem.js/dist'));
|
||||||
|
|
||||||
app.get('/', function(req, res){
|
app.get('/', function(req, res){
|
||||||
res.sendFile(__dirname + '/index.html');
|
res.sendFile(__dirname + '/index.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/style.css', function(req, res){
|
app.get('/style.css', function(req, res){
|
||||||
res.sendFile(__dirname + '/style.css');
|
res.sendFile(__dirname + '../style.css');
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/main.js', function(req, res){
|
app.get('/main.js', function(req, res){
|
||||||
@@ -6,6 +6,11 @@ var term,
|
|||||||
socket,
|
socket,
|
||||||
pid;
|
pid;
|
||||||
|
|
||||||
|
Terminal.applyAddon(fit);
|
||||||
|
Terminal.applyAddon(attach);
|
||||||
|
Terminal.applyAddon(zmodem);
|
||||||
|
Terminal.applyAddon(search);
|
||||||
|
|
||||||
var terminalContainer = document.getElementById('terminal-container'),
|
var terminalContainer = document.getElementById('terminal-container'),
|
||||||
actionElements = {
|
actionElements = {
|
||||||
findNext: document.querySelector('#find-next'),
|
findNext: document.querySelector('#find-next'),
|
||||||
-26
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"source": {
|
|
||||||
"include": [
|
|
||||||
"src/"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"src/test/"
|
|
||||||
],
|
|
||||||
"excludePattern": "src/.+\\.test\\.(js|ts)$"
|
|
||||||
},
|
|
||||||
"opts": {
|
|
||||||
"readme": "README.md",
|
|
||||||
"template": "node_modules/docdash",
|
|
||||||
"encoding": "utf8",
|
|
||||||
"destination": "docs/",
|
|
||||||
"recurse": true,
|
|
||||||
"verbose": true
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
"plugins/markdown"
|
|
||||||
],
|
|
||||||
"templates": {
|
|
||||||
"cleverLinks": false,
|
|
||||||
"monospaceLinks": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
-15661
File diff suppressed because it is too large
Load Diff
+6
-6
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "xterm",
|
"name": "xterm",
|
||||||
"description": "Full xterm terminal, in your browser",
|
"description": "Full xterm terminal, in your browser",
|
||||||
"version": "3.2.0",
|
"version": "3.3.0",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"demo",
|
"demo",
|
||||||
"test",
|
"test",
|
||||||
@@ -46,7 +46,6 @@
|
|||||||
"@types/text-encoding": "0.0.32",
|
"@types/text-encoding": "0.0.32",
|
||||||
"browserify": "^13.3.0",
|
"browserify": "^13.3.0",
|
||||||
"chai": "3.5.0",
|
"chai": "3.5.0",
|
||||||
"docdash": "0.4.0",
|
|
||||||
"express": "4.13.4",
|
"express": "4.13.4",
|
||||||
"express-ws": "2.0.0-rc.1",
|
"express-ws": "2.0.0-rc.1",
|
||||||
"fs-extra": "^1.0.0",
|
"fs-extra": "^1.0.0",
|
||||||
@@ -65,6 +64,7 @@
|
|||||||
"merge-stream": "^1.0.1",
|
"merge-stream": "^1.0.1",
|
||||||
"node-pty": "^0.7.2",
|
"node-pty": "^0.7.2",
|
||||||
"nodemon": "1.10.2",
|
"nodemon": "1.10.2",
|
||||||
|
"npm-run-all": "^4.1.2",
|
||||||
"sorcery": "^0.10.0",
|
"sorcery": "^0.10.0",
|
||||||
"tslint": "^5.9.1",
|
"tslint": "^5.9.1",
|
||||||
"typescript": "~2.7.1",
|
"typescript": "~2.7.1",
|
||||||
@@ -76,10 +76,10 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node demo/app",
|
"start": "node demo/app",
|
||||||
"prestart-zmodem": "npm run build",
|
"start-zmodem": "node demo/zmodem/app",
|
||||||
"start-zmodem": "node build/addons/zmodem/demo/app",
|
"lint": "tslint src/*.ts src/**/*.ts src/addons/**/*.ts",
|
||||||
"lint": "tslint src/*.ts src/**/*.ts",
|
"test": "npm-run-all mocha lint",
|
||||||
"test": "gulp test",
|
"mocha": "gulp test",
|
||||||
"build:docs": "jsdoc -c jsdoc.json",
|
"build:docs": "jsdoc -c jsdoc.json",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
|
|||||||
+16
-10
@@ -122,8 +122,6 @@ const DEFAULT_OPTIONS: ITerminalOptions = {
|
|||||||
tabStopWidth: 8,
|
tabStopWidth: 8,
|
||||||
theme: null,
|
theme: null,
|
||||||
rightClickSelectsWord: Browser.isMac
|
rightClickSelectsWord: Browser.isMac
|
||||||
// programFeatures: false,
|
|
||||||
// focusKeys: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export class Terminal extends EventEmitter implements ITerminal, IDisposable, IInputHandlingTerminal {
|
export class Terminal extends EventEmitter implements ITerminal, IDisposable, IInputHandlingTerminal {
|
||||||
@@ -474,8 +472,10 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
|
|||||||
case 'fontFamily':
|
case 'fontFamily':
|
||||||
case 'fontSize':
|
case 'fontSize':
|
||||||
// When the font changes the size of the cells may change which requires a renderer clear
|
// When the font changes the size of the cells may change which requires a renderer clear
|
||||||
this.renderer.clear();
|
if (this.renderer) {
|
||||||
this.charMeasure.measure(this.options);
|
this.renderer.clear();
|
||||||
|
this.charMeasure.measure(this.options);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'enableBold':
|
case 'enableBold':
|
||||||
case 'letterSpacing':
|
case 'letterSpacing':
|
||||||
@@ -483,12 +483,16 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
|
|||||||
case 'fontWeight':
|
case 'fontWeight':
|
||||||
case 'fontWeightBold':
|
case 'fontWeightBold':
|
||||||
// When the font changes the size of the cells may change which requires a renderer clear
|
// When the font changes the size of the cells may change which requires a renderer clear
|
||||||
this.renderer.clear();
|
if (this.renderer) {
|
||||||
this.renderer.onResize(this.cols, this.rows);
|
this.renderer.clear();
|
||||||
this.refresh(0, this.rows - 1);
|
this.renderer.onResize(this.cols, this.rows);
|
||||||
|
this.refresh(0, this.rows - 1);
|
||||||
|
}
|
||||||
case 'scrollback':
|
case 'scrollback':
|
||||||
this.buffers.resize(this.cols, this.rows);
|
this.buffers.resize(this.cols, this.rows);
|
||||||
this.viewport.syncScrollArea();
|
if (this.viewport) {
|
||||||
|
this.viewport.syncScrollArea();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'screenReaderMode':
|
case 'screenReaderMode':
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -1939,7 +1943,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
|
|||||||
|
|
||||||
if (x === this.cols && y === this.rows) {
|
if (x === this.cols && y === this.rows) {
|
||||||
// Check if we still need to measure the char size (fixes #785).
|
// Check if we still need to measure the char size (fixes #785).
|
||||||
if (!this.charMeasure.width || !this.charMeasure.height) {
|
if (this.charMeasure && (!this.charMeasure.width || !this.charMeasure.height)) {
|
||||||
this.charMeasure.measure(this.options);
|
this.charMeasure.measure(this.options);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -2181,7 +2185,9 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
|
|||||||
this._customKeyEventHandler = customKeyEventHandler;
|
this._customKeyEventHandler = customKeyEventHandler;
|
||||||
this._inputHandler = inputHandler;
|
this._inputHandler = inputHandler;
|
||||||
this.refresh(0, this.rows - 1);
|
this.refresh(0, this.rows - 1);
|
||||||
this.viewport.syncScrollArea();
|
if (this.viewport) {
|
||||||
|
this.viewport.syncScrollArea();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function attach(term: Terminal, socket: WebSocket, bidirectional: boolean
|
|||||||
addonTerminal.__getMessage = function(ev: MessageEvent): void {
|
addonTerminal.__getMessage = function(ev: MessageEvent): void {
|
||||||
let str;
|
let str;
|
||||||
|
|
||||||
if (typeof ev.data == 'object') {
|
if (typeof ev.data === 'object') {
|
||||||
if (!myTextDecoder) {
|
if (!myTextDecoder) {
|
||||||
myTextDecoder = new TextDecoder();
|
myTextDecoder = new TextDecoder();
|
||||||
}
|
}
|
||||||
@@ -53,14 +53,14 @@ export function attach(term: Terminal, socket: WebSocket, bidirectional: boolean
|
|||||||
} else {
|
} else {
|
||||||
let fileReader = new FileReader();
|
let fileReader = new FileReader();
|
||||||
|
|
||||||
fileReader.addEventListener('load', function() {
|
fileReader.addEventListener('load', () => {
|
||||||
str = myTextDecoder.decode(this.result);
|
str = myTextDecoder.decode(this.result);
|
||||||
displayData(str);
|
displayData(str);
|
||||||
});
|
});
|
||||||
fileReader.readAsArrayBuffer(ev.data);
|
fileReader.readAsArrayBuffer(ev.data);
|
||||||
}
|
}
|
||||||
} else if (typeof ev.data == 'string') {
|
} else if (typeof ev.data === 'string') {
|
||||||
displayData(ev.data)
|
displayData(ev.data);
|
||||||
} else {
|
} else {
|
||||||
throw Error(`Cannot handle "${typeof ev.data}" websocket message.`);
|
throw Error(`Cannot handle "${typeof ev.data}" websocket message.`);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ export function attach(term: Terminal, socket: WebSocket, bidirectional: boolean
|
|||||||
* @param str String decoded by FileReader.
|
* @param str String decoded by FileReader.
|
||||||
* @param data The data of the EventMessage.
|
* @param data The data of the EventMessage.
|
||||||
*/
|
*/
|
||||||
function displayData(str?: string, data?: string) {
|
function displayData(str?: string, data?: string): void {
|
||||||
if (buffered) {
|
if (buffered) {
|
||||||
addonTerminal.__pushToBuffer(str || data);
|
addonTerminal.__pushToBuffer(str || data);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -38,11 +38,12 @@ import { Terminal } from 'xterm';
|
|||||||
|
|
||||||
let zmodem;
|
let zmodem;
|
||||||
|
|
||||||
export interface IZModemOptions {
|
export interface IZmodemOptions {
|
||||||
noTerminalWriteOutsideSession?: boolean;
|
noTerminalWriteOutsideSession?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function zmodemAttach(term: Terminal, ws: WebSocket, opts: IZModemOptions = {}): void {
|
function zmodemAttach(ws: WebSocket, opts: IZmodemOptions = {}): void {
|
||||||
|
const term = this;
|
||||||
const senderFunc = (octets: ArrayLike<number>) => ws.send(new Uint8Array(octets));
|
const senderFunc = (octets: ArrayLike<number>) => ws.send(new Uint8Array(octets));
|
||||||
|
|
||||||
let zsentry;
|
let zsentry;
|
||||||
@@ -85,8 +86,8 @@ export function zmodemAttach(term: Terminal, ws: WebSocket, opts: IZModemOptions
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function apply(terminalConstructor: typeof Terminal): void {
|
export function apply(terminalConstructor: typeof Terminal): void {
|
||||||
zmodem = (typeof window === 'object') ? (<any>window).ZModem : {Browser: null}; // Nullify browser for tests
|
zmodem = (typeof window === 'object') ? (<any>window).Zmodem : {Browser: null}; // Nullify browser for tests
|
||||||
|
|
||||||
(<any>terminalConstructor.prototype).zmodemAttach = zmodemAttach.bind(this, this);
|
(<any>terminalConstructor.prototype).zmodemAttach = zmodemAttach;
|
||||||
(<any>terminalConstructor.prototype).zmodemBrowser = zmodem.Browser;
|
(<any>terminalConstructor.prototype).zmodemBrowser = zmodem.Browser;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user