Merge branch 'master' into 1152_npe_selection_manager_2
This commit is contained in:
@@ -19,45 +19,63 @@ 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>
|
||||||
Brian Mock <brian@mockbrian.com>
|
Brian Mock <brian@mockbrian.com>
|
||||||
|
Bruno Ribeito <b.m.fernandes.ribeiro@gmail.com>
|
||||||
Carson Anderson <carson@betterservers.com>
|
Carson Anderson <carson@betterservers.com>
|
||||||
CHaBou <chabup@delean.fr>
|
CHaBou <chabup@delean.fr>
|
||||||
Christian Budde Christensen <budde377@gmail.com>
|
Christian Budde Christensen <budde377@gmail.com>
|
||||||
Christof Marti <chrmarti@microsoft.com>
|
Christof Marti <chrmarti@microsoft.com>
|
||||||
Christopher Jeffrey <chjjeffrey@gmail.com>
|
Christopher Jeffrey <chjjeffrey@gmail.com>
|
||||||
coderaiser <mnemonic.enemy@gmail.com>
|
coderaiser <mnemonic.enemy@gmail.com>
|
||||||
|
Dan Brown <jdanbrown@gmail.com>
|
||||||
|
Daniel Griffen <daniel@griffen.io>
|
||||||
Daniel Imms <daimms@microsoft.com>
|
Daniel Imms <daimms@microsoft.com>
|
||||||
Daniel Risacher <drisacher@gmail.com>
|
Daniel Risacher <drisacher@gmail.com>
|
||||||
Dan Kaplun <dbkaplun@twitch.tv>
|
Dan Kaplun <dbkaplun@twitch.tv>
|
||||||
Darin Morrison <freebroccolo@users.noreply.github.com>
|
Darin Morrison <freebroccolo@users.noreply.github.com>
|
||||||
|
dcylabs <dcylabs@gmail.com>
|
||||||
|
Dominik Csapak <d.csapak@proxmox.com>
|
||||||
Edgar Andrés Margffoy Tuay <andfoy@gmail.com>
|
Edgar Andrés Margffoy Tuay <andfoy@gmail.com>
|
||||||
Elliot Saba <staticfloat@gmail.com>
|
Elliot Saba <staticfloat@gmail.com>
|
||||||
|
Exile <exile@chamber.ee>
|
||||||
|
Felipe Gasper <felipe@felipegasper.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>
|
||||||
Ian Lewis <ianlewis@google.com>
|
Ian Lewis <ianlewis@google.com>
|
||||||
imoses <ido@twiggle.com>
|
imoses <ido@twiggle.com>
|
||||||
InDieTasten <indietasten@gmail.com>
|
InDieTasten <indietasten@gmail.com>
|
||||||
irokas <akasidiari@inf.uth.gr>
|
irokas <akasidiari@inf.uth.gr>
|
||||||
|
Jakob Gillich <jakob@gillich.me>
|
||||||
Jean Bruenn <himself@jeanbruenn.info>
|
Jean Bruenn <himself@jeanbruenn.info>
|
||||||
Jeremy Danyow <jedanyow@microsoft.com>
|
Jeremy Danyow <jedanyow@microsoft.com>
|
||||||
Joao Moreno <jomo@microsoft.com>
|
Joao Moreno <jomo@microsoft.com>
|
||||||
Joao Moreno <mail@joaomoreno.com>
|
Joao Moreno <mail@joaomoreno.com>
|
||||||
|
Johannes Zellner <johannes@nebulon.de>
|
||||||
Jon Masters <jon.masters@sky.com>
|
Jon Masters <jon.masters@sky.com>
|
||||||
Jörg Breitbart <jerch@rockborn.de>
|
Jörg Breitbart <jerch@rockborn.de>
|
||||||
Justin Mecham <justin@mecham.me>
|
Justin Mecham <justin@mecham.me>
|
||||||
Kirill Merkushev <lanwen@yandex.ru>
|
Kirill Merkushev <lanwen@yandex.ru>
|
||||||
|
Luca <LucaT1@users.noreply.github.com>
|
||||||
Lucian Buzzo <lucian.buzzo@gmail.com>
|
Lucian Buzzo <lucian.buzzo@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>
|
||||||
Martin Chloride <i@martincl2.me>
|
Martin Chloride <i@martincl2.me>
|
||||||
|
Martin Koppehel <martin.koppehel@st.ovgu.de>
|
||||||
Martin Wang <jiahaow@ca.ibm.com>
|
Martin Wang <jiahaow@ca.ibm.com>
|
||||||
Matt Bierner <matb@microsoft.com>
|
Matt Bierner <matb@microsoft.com>
|
||||||
Michael Irwin <mikesir87@gmail.com>
|
Michael Irwin <mikesir87@gmail.com>
|
||||||
Mikko Karvonen <mikko.karvonen@arm.com>
|
Mikko Karvonen <mikko.karvonen@arm.com>
|
||||||
mofux <t.zilz@mofux.org>
|
mofux <t.zilz@mofux.org>
|
||||||
Nicolas Ramz <nicolas.ramz@gmail.com>
|
Nicolas Ramz <nicolas.ramz@gmail.com>
|
||||||
|
npezza93 <npezza93@gmail.com>
|
||||||
Oleksandr Andriienko <oandriie@redhat.com>
|
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>
|
||||||
|
Rick Baker <rick@ricktbaker.com>
|
||||||
runarberg <runar@greenqloud.com>
|
runarberg <runar@greenqloud.com>
|
||||||
|
Samuel Williams <samuel.williams@oriontransfer.co.nz>
|
||||||
Saswat Das <saswatds@users.noreply.github.com>
|
Saswat Das <saswatds@users.noreply.github.com>
|
||||||
Saul Costa <saul@codevolve.com>
|
Saul Costa <saul@codevolve.com>
|
||||||
Shuanglei Tao <tsl0922@gmail.com>
|
Shuanglei Tao <tsl0922@gmail.com>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# [](https://xtermjs.org)
|
# [](https://xtermjs.org)
|
||||||
|
|
||||||
[](https://travis-ci.org/sourcelair/xterm.js) [](https://coveralls.io/github/sourcelair/xterm.js) [](https://gitter.im/sourcelair/xterm.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://www.jsdelivr.com/package/npm/xterm)
|
[](https://travis-ci.org/xtermjs/xterm.js) [](https://coveralls.io/github/sourcelair/xterm.js) [](https://gitter.im/sourcelair/xterm.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://www.jsdelivr.com/package/npm/xterm)
|
||||||
|
|
||||||
Xterm.js is a terminal front-end component written in JavaScript that works in the browser.
|
Xterm.js is a terminal front-end component written in JavaScript that works in the browser.
|
||||||
|
|
||||||
@@ -115,6 +115,10 @@ computational environment for Jupyter, supporting interactive data science and s
|
|||||||
- [**Theia**](https://github.com/theia-ide/theia): Theia is a cloud & desktop IDE framework implemented in TypeScript.
|
- [**Theia**](https://github.com/theia-ide/theia): Theia is a cloud & desktop IDE framework implemented in TypeScript.
|
||||||
- [**Opshell**](https://github.com/ricktbaker/opshell) Ops Helper tool to make life easier working with AWS instances across multiple organizations.
|
- [**Opshell**](https://github.com/ricktbaker/opshell) Ops Helper tool to make life easier working with AWS instances across multiple organizations.
|
||||||
- [**Proxmox VE**](https://www.proxmox.com/en/proxmox-ve): Proxmox VE is a complete open-source platform for enterprise virtualization. It uses xterm.js for container terminals and the host shell.
|
- [**Proxmox VE**](https://www.proxmox.com/en/proxmox-ve): Proxmox VE is a complete open-source platform for enterprise virtualization. It uses xterm.js for container terminals and the host shell.
|
||||||
|
- [**Script Runner**](https://github.com/ioquatix/script-runner): Run scripts (or a shell) in Atom.
|
||||||
|
- [**Whack Whack Terminal**](https://github.com/Microsoft/WhackWhackTerminal): Terminal emulator for Visual Studio 2017.
|
||||||
|
- [**VTerm**](https://github.com/vterm/vterm): Extensible terminal emulator based on Electron and React.
|
||||||
|
- [**electerm**](http://electerm.html5beta.com): electerm is a terminal/ssh/sftp client(mac, win, linux) based on electron/node-pty/xterm.
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ namespace properties {
|
|||||||
|
|
||||||
namespace static_methods {
|
namespace static_methods {
|
||||||
{
|
{
|
||||||
Terminal.loadAddon('attach');
|
Terminal.applyAddon({});
|
||||||
Terminal.loadAddon('fit');
|
Terminal.applyAddon({});
|
||||||
Terminal.loadAddon('fullscreen');
|
Terminal.applyAddon({});
|
||||||
Terminal.loadAddon('search');
|
Terminal.applyAddon({});
|
||||||
Terminal.loadAddon('terminado');
|
Terminal.applyAddon({});
|
||||||
Terminal.loadAddon('winptyCompat');
|
Terminal.applyAddon({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "xterm",
|
"name": "xterm",
|
||||||
"description": "Full xterm terminal, in your browser",
|
"description": "Full xterm terminal, in your browser",
|
||||||
"version": "2.9.1",
|
"version": "3.0.0",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"demo",
|
"demo",
|
||||||
"test",
|
"test",
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
],
|
],
|
||||||
"main": "lib/Terminal.js",
|
"main": "lib/Terminal.js",
|
||||||
"types": "typings/xterm.d.ts",
|
"types": "typings/xterm.d.ts",
|
||||||
"repository": "https://github.com/sourcelair/xterm.js",
|
"repository": "https://github.com/xtermjs/xterm.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"files": [
|
"files": [
|
||||||
"*.js",
|
"*.js",
|
||||||
@@ -35,7 +35,8 @@
|
|||||||
"src/*.ts",
|
"src/*.ts",
|
||||||
"src/**/*.js",
|
"src/**/*.js",
|
||||||
"src/**/*.js.map",
|
"src/**/*.js.map",
|
||||||
"src/**/*.ts"
|
"src/**/*.ts",
|
||||||
|
"typings/*.d.ts"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "^3.4.34",
|
"@types/chai": "^3.4.34",
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ import { BufferSet } from './BufferSet';
|
|||||||
import { MockTerminal } from './utils/TestUtils.test';
|
import { MockTerminal } from './utils/TestUtils.test';
|
||||||
import { LineData, CharData } from './Types';
|
import { LineData, CharData } from './Types';
|
||||||
|
|
||||||
|
class TestMockTerminal extends MockTerminal {
|
||||||
|
emit(event: string, data: any): void {}
|
||||||
|
}
|
||||||
|
|
||||||
class TestSelectionManager extends SelectionManager {
|
class TestSelectionManager extends SelectionManager {
|
||||||
constructor(
|
constructor(
|
||||||
terminal: ITerminal,
|
terminal: ITerminal,
|
||||||
@@ -48,7 +52,7 @@ describe('SelectionManager', () => {
|
|||||||
dom = new jsdom.JSDOM('');
|
dom = new jsdom.JSDOM('');
|
||||||
window = dom.window;
|
window = dom.window;
|
||||||
document = window.document;
|
document = window.document;
|
||||||
terminal = new MockTerminal();
|
terminal = new TestMockTerminal();
|
||||||
terminal.cols = 80;
|
terminal.cols = 80;
|
||||||
terminal.rows = 2;
|
terminal.rows = 2;
|
||||||
terminal.options.scrollback = 100;
|
terminal.options.scrollback = 100;
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
|
|||||||
public selectAll(): void {
|
public selectAll(): void {
|
||||||
this._model.isSelectAllActive = true;
|
this._model.isSelectAllActive = true;
|
||||||
this.refresh();
|
this.refresh();
|
||||||
this.emit('selection');
|
this._terminal.emit('selection');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -544,7 +544,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
|
|||||||
this._removeMouseDownListeners();
|
this._removeMouseDownListeners();
|
||||||
|
|
||||||
if (this.hasSelection)
|
if (this.hasSelection)
|
||||||
this.emit('selection');
|
this._terminal.emit('selection');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+11
-3
@@ -593,9 +593,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
|||||||
this.viewportScrollArea.classList.add('xterm-scroll-area');
|
this.viewportScrollArea.classList.add('xterm-scroll-area');
|
||||||
this.viewportElement.appendChild(this.viewportScrollArea);
|
this.viewportElement.appendChild(this.viewportScrollArea);
|
||||||
|
|
||||||
// preload audio
|
|
||||||
this.syncBellSound();
|
|
||||||
|
|
||||||
this._mouseZoneManager = new MouseZoneManager(this);
|
this._mouseZoneManager = new MouseZoneManager(this);
|
||||||
this.on('scroll', () => this._mouseZoneManager.clearAll());
|
this.on('scroll', () => this._mouseZoneManager.clearAll());
|
||||||
this.linkifier.attachToDom(this._mouseZoneManager);
|
this.linkifier.attachToDom(this._mouseZoneManager);
|
||||||
@@ -625,6 +622,9 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
|||||||
this.helperContainer.appendChild(this.charSizeStyleElement);
|
this.helperContainer.appendChild(this.charSizeStyleElement);
|
||||||
this.charMeasure = new CharMeasure(document, this.helperContainer);
|
this.charMeasure = new CharMeasure(document, this.helperContainer);
|
||||||
|
|
||||||
|
// Preload audio, this relied on helperContainer
|
||||||
|
this.syncBellSound();
|
||||||
|
|
||||||
// Performance: Add viewport and helper elements from the fragment
|
// Performance: Add viewport and helper elements from the fragment
|
||||||
this.element.appendChild(fragment);
|
this.element.appendChild(fragment);
|
||||||
|
|
||||||
@@ -1449,6 +1449,9 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
|||||||
if (ev.shiftKey) {
|
if (ev.shiftKey) {
|
||||||
result.key = C0.BS; // ^H
|
result.key = C0.BS; // ^H
|
||||||
break;
|
break;
|
||||||
|
} else if (ev.altKey) {
|
||||||
|
result.key = C0.ESC + C0.DEL; // \e ^?
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
result.key = C0.DEL; // ^?
|
result.key = C0.DEL; // ^?
|
||||||
break;
|
break;
|
||||||
@@ -2116,6 +2119,11 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
|||||||
}
|
}
|
||||||
|
|
||||||
private syncBellSound(): void {
|
private syncBellSound(): void {
|
||||||
|
// Don't update anything if the terminal has not been opened yet
|
||||||
|
if (!this.element) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.soundBell() && this.bellAudioElement) {
|
if (this.soundBell() && this.bellAudioElement) {
|
||||||
this.bellAudioElement.setAttribute('src', this.options.bellSound);
|
this.bellAudioElement.setAttribute('src', this.options.bellSound);
|
||||||
} else if (this.soundBell()) {
|
} else if (this.soundBell()) {
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ export function attach(term, socket, bidirectional, buffered) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
term._sendData = function(data) {
|
term._sendData = function(data) {
|
||||||
|
if (socket.readyState !== 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
socket.send(data);
|
socket.send(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export function proposeGeometry(term) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function fit(term) {
|
export function fit(term) {
|
||||||
var geometry = exports.proposeGeometry(term);
|
var geometry = proposeGeometry(term);
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
// Force a full render
|
// Force a full render
|
||||||
if (term.rows !== geometry.rows || term.cols !== geometry.cols) {
|
if (term.rows !== geometry.rows || term.cols !== geometry.cols) {
|
||||||
|
|||||||
Vendored
+4
-4
@@ -500,10 +500,10 @@ declare module 'xterm' {
|
|||||||
reset(): void
|
reset(): void
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads an addon, attaching it to the Terminal prototype and making it
|
* Applies an addon to the Terminal prototype, making it available to all
|
||||||
* available to all newly created Terminals.
|
* newly created Terminals.
|
||||||
* @param addon The addon to load.
|
* @param addon The addon to apply.
|
||||||
*/
|
*/
|
||||||
static loadAddon(addon: 'attach' | 'fit' | 'fullscreen' | 'search' | 'terminado' | 'winptyCompat'): void;
|
static applyAddon(addon: any): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user