diff --git a/AUTHORS b/AUTHORS index 984b896f..1bd4c87d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -19,45 +19,63 @@ Bill Church Bob Reid bottleofwater Brian Mock +Bruno Ribeito Carson Anderson CHaBou Christian Budde Christensen Christof Marti Christopher Jeffrey coderaiser +Dan Brown +Daniel Griffen Daniel Imms Daniel Risacher Dan Kaplun Darin Morrison +dcylabs +Dominik Csapak Edgar Andrés Margffoy Tuay Elliot Saba +Exile +Felipe Gasper +ficristo Gary Ritchie hiro-su Ian Lewis imoses InDieTasten irokas +Jakob Gillich Jean Bruenn Jeremy Danyow Joao Moreno Joao Moreno +Johannes Zellner Jon Masters Jörg Breitbart Justin Mecham Kirill Merkushev +Luca Lucian Buzzo +Lukas Drgon Maël Nison +Marc Dumais Martin Chloride +Martin Koppehel Martin Wang Matt Bierner Michael Irwin Mikko Karvonen mofux Nicolas Ramz +npezza93 Oleksandr Andriienko Paris Kasidiaris Paris Kasidiaris +Peter Baumgarten +Rick Baker runarberg +Samuel Williams Saswat Das Saul Costa Shuanglei Tao diff --git a/README.md b/README.md index 3ff9b205..5a77806f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [![xterm.js logo](logo-full.png)](https://xtermjs.org) -[![xterm.js build status](https://api.travis-ci.org/sourcelair/xterm.js.svg)](https://travis-ci.org/sourcelair/xterm.js) [![Coverage Status](https://coveralls.io/repos/github/sourcelair/xterm.js/badge.svg)](https://coveralls.io/github/sourcelair/xterm.js) [![Gitter](https://badges.gitter.im/sourcelair/xterm.js.svg)](https://gitter.im/sourcelair/xterm.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/xterm/badge?style=rounded)](https://www.jsdelivr.com/package/npm/xterm) +[![xterm.js build status](https://api.travis-ci.org/xtermjs/xterm.js.svg)](https://travis-ci.org/xtermjs/xterm.js) [![Coverage Status](https://coveralls.io/repos/github/sourcelair/xterm.js/badge.svg)](https://coveralls.io/github/sourcelair/xterm.js) [![Gitter](https://badges.gitter.im/sourcelair/xterm.js.svg)](https://gitter.im/sourcelair/xterm.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/xterm/badge?style=rounded)](https://www.jsdelivr.com/package/npm/xterm) 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. - [**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. +- [**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. diff --git a/fixtures/typings-test/typings-test.ts b/fixtures/typings-test/typings-test.ts index cfad7b26..5a5f6c50 100644 --- a/fixtures/typings-test/typings-test.ts +++ b/fixtures/typings-test/typings-test.ts @@ -36,12 +36,12 @@ namespace properties { namespace static_methods { { - Terminal.loadAddon('attach'); - Terminal.loadAddon('fit'); - Terminal.loadAddon('fullscreen'); - Terminal.loadAddon('search'); - Terminal.loadAddon('terminado'); - Terminal.loadAddon('winptyCompat'); + Terminal.applyAddon({}); + Terminal.applyAddon({}); + Terminal.applyAddon({}); + Terminal.applyAddon({}); + Terminal.applyAddon({}); + Terminal.applyAddon({}); } } diff --git a/package.json b/package.json index e4bb08c1..1dfadf9f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "xterm", "description": "Full xterm terminal, in your browser", - "version": "2.9.1", + "version": "3.0.0", "ignore": [ "demo", "test", @@ -9,7 +9,7 @@ ], "main": "lib/Terminal.js", "types": "typings/xterm.d.ts", - "repository": "https://github.com/sourcelair/xterm.js", + "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "files": [ "*.js", @@ -35,7 +35,8 @@ "src/*.ts", "src/**/*.js", "src/**/*.js.map", - "src/**/*.ts" + "src/**/*.ts", + "typings/*.d.ts" ], "devDependencies": { "@types/chai": "^3.4.34", diff --git a/src/SelectionManager.test.ts b/src/SelectionManager.test.ts index 8c6ea3e1..a10dc669 100644 --- a/src/SelectionManager.test.ts +++ b/src/SelectionManager.test.ts @@ -14,6 +14,10 @@ import { BufferSet } from './BufferSet'; import { MockTerminal } from './utils/TestUtils.test'; import { LineData, CharData } from './Types'; +class TestMockTerminal extends MockTerminal { + emit(event: string, data: any): void {} +} + class TestSelectionManager extends SelectionManager { constructor( terminal: ITerminal, @@ -48,7 +52,7 @@ describe('SelectionManager', () => { dom = new jsdom.JSDOM(''); window = dom.window; document = window.document; - terminal = new MockTerminal(); + terminal = new TestMockTerminal(); terminal.cols = 80; terminal.rows = 2; terminal.options.scrollback = 100; diff --git a/src/SelectionManager.ts b/src/SelectionManager.ts index 37f0ab14..cd6fc996 100644 --- a/src/SelectionManager.ts +++ b/src/SelectionManager.ts @@ -255,7 +255,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager public selectAll(): void { this._model.isSelectAllActive = true; this.refresh(); - this.emit('selection'); + this._terminal.emit('selection'); } /** @@ -544,7 +544,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager this._removeMouseDownListeners(); if (this.hasSelection) - this.emit('selection'); + this._terminal.emit('selection'); } /** diff --git a/src/Terminal.ts b/src/Terminal.ts index b685c8cd..7abb32b7 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -593,9 +593,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT this.viewportScrollArea.classList.add('xterm-scroll-area'); this.viewportElement.appendChild(this.viewportScrollArea); - // preload audio - this.syncBellSound(); - this._mouseZoneManager = new MouseZoneManager(this); this.on('scroll', () => this._mouseZoneManager.clearAll()); this.linkifier.attachToDom(this._mouseZoneManager); @@ -625,6 +622,9 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT this.helperContainer.appendChild(this.charSizeStyleElement); this.charMeasure = new CharMeasure(document, this.helperContainer); + // Preload audio, this relied on helperContainer + this.syncBellSound(); + // Performance: Add viewport and helper elements from the fragment this.element.appendChild(fragment); @@ -1449,6 +1449,9 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT if (ev.shiftKey) { result.key = C0.BS; // ^H break; + } else if (ev.altKey) { + result.key = C0.ESC + C0.DEL; // \e ^? + break; } result.key = C0.DEL; // ^? break; @@ -2116,6 +2119,11 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT } private syncBellSound(): void { + // Don't update anything if the terminal has not been opened yet + if (!this.element) { + return; + } + if (this.soundBell() && this.bellAudioElement) { this.bellAudioElement.setAttribute('src', this.options.bellSound); } else if (this.soundBell()) { diff --git a/src/addons/attach/attach.ts b/src/addons/attach/attach.ts index aade7291..4e0d5941 100644 --- a/src/addons/attach/attach.ts +++ b/src/addons/attach/attach.ts @@ -59,6 +59,9 @@ export function attach(term, socket, bidirectional, buffered) { }; term._sendData = function(data) { + if (socket.readyState !== 1) { + return; + } socket.send(data); }; diff --git a/src/addons/fit/fit.ts b/src/addons/fit/fit.ts index f8e02015..b87ccc07 100644 --- a/src/addons/fit/fit.ts +++ b/src/addons/fit/fit.ts @@ -34,7 +34,7 @@ export function proposeGeometry(term) { }; export function fit(term) { - var geometry = exports.proposeGeometry(term); + var geometry = proposeGeometry(term); if (geometry) { // Force a full render if (term.rows !== geometry.rows || term.cols !== geometry.cols) { diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 97e4a4a3..83199e08 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -500,10 +500,10 @@ declare module 'xterm' { reset(): void /** - * Loads an addon, attaching it to the Terminal prototype and making it - * available to all newly created Terminals. - * @param addon The addon to load. + * Applies an addon to the Terminal prototype, making it available to all + * newly created Terminals. + * @param addon The addon to apply. */ - static loadAddon(addon: 'attach' | 'fit' | 'fullscreen' | 'search' | 'terminado' | 'winptyCompat'): void; + static applyAddon(addon: any): void; } }