From 81c5fd49880e508dacd2e03edeab7e74e80c0ff7 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 6 Sep 2019 09:27:20 -0700 Subject: [PATCH 01/10] Don't execute move to cell when the user has scrolled up Fixes #2401 --- src/browser/services/SelectionService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/services/SelectionService.ts b/src/browser/services/SelectionService.ts index 90c85ecd..2efb095d 100644 --- a/src/browser/services/SelectionService.ts +++ b/src/browser/services/SelectionService.ts @@ -664,7 +664,7 @@ export class SelectionService implements ISelectionService { this._removeMouseDownListeners(); if (this.selectionText.length <= 1 && timeElapsed < ALT_CLICK_MOVE_CURSOR_TIME) { - if (event.altKey) { + if (event.altKey && this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) { const coordinates = this._mouseService.getCoords( event, this._element, From f7dade1023178bcae5a3eccee728daec46afedfd Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 9 Sep 2019 09:28:33 -0700 Subject: [PATCH 02/10] Add/polish the readme for all addons Fixes #2193 --- addons/xterm-addon-attach/README.md | 22 ++++++++++++++++++++++ addons/xterm-addon-fit/README.md | 24 ++++++++++++++++++++++++ addons/xterm-addon-search/README.md | 23 +++++++++++++++++++++++ addons/xterm-addon-web-links/README.md | 6 ++---- addons/xterm-addon-webgl/README.md | 23 +++++++++++++++++++++++ 5 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 addons/xterm-addon-attach/README.md create mode 100644 addons/xterm-addon-fit/README.md create mode 100644 addons/xterm-addon-search/README.md create mode 100644 addons/xterm-addon-webgl/README.md diff --git a/addons/xterm-addon-attach/README.md b/addons/xterm-addon-attach/README.md new file mode 100644 index 00000000..2040455c --- /dev/null +++ b/addons/xterm-addon-attach/README.md @@ -0,0 +1,22 @@ +## xterm-addon-attach + +An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables attaching to a web socket. This addon requires xterm.js v4+. + +### Install + +```bash +npm install --save xterm-addon-attach +``` + +### Usage + +```ts +import { Terminal } from 'xterm'; +import { FitAddon } from 'xterm-addon-attach'; + +const terminal = new Terminal(); +const attachAddon = new AttachAddon(webSocket); +terminal.loadAddon(attachAddon); +``` + +See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-attach/typings/xterm-addon-attach.d.ts) for more advanced usage. diff --git a/addons/xterm-addon-fit/README.md b/addons/xterm-addon-fit/README.md new file mode 100644 index 00000000..321b2cf7 --- /dev/null +++ b/addons/xterm-addon-fit/README.md @@ -0,0 +1,24 @@ +## xterm-addon-fit + +An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables fitting the terminal's dimensions to a containing element. This addon requires xterm.js v4+. + +### Install + +```bash +npm install --save xterm-addon-fit +``` + +### Usage + +```ts +import { Terminal } from 'xterm'; +import { FitAddon } from 'xterm-addon-fit'; + +const terminal = new Terminal(); +const fitAddon = new FitAddon(); +terminal.loadAddon(fitAddon); +terminal.open(containerElement); +fitAddon.fit(); +``` + +See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-fit/typings/xterm-addon-fit.d.ts) for more advanced usage. diff --git a/addons/xterm-addon-search/README.md b/addons/xterm-addon-search/README.md new file mode 100644 index 00000000..91bcc34b --- /dev/null +++ b/addons/xterm-addon-search/README.md @@ -0,0 +1,23 @@ +## xterm-addon-search + +An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables searching the buffer. This addon requires xterm.js v4+. + +### Install + +```bash +npm install --save xterm-addon-search +``` + +### Usage + +```ts +import { Terminal } from 'xterm'; +import { SearchAddon } from 'xterm-addon-search'; + +const terminal = new Terminal(); +const searchAddon = new SearchAddon(); +terminal.loadAddon(searchAddon); +searchAddon.findNext('foo'); +``` + +See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-search/typings/xterm-addon-search.d.ts) for more advanced usage. diff --git a/addons/xterm-addon-web-links/README.md b/addons/xterm-addon-web-links/README.md index dc9e1c32..e53f4edf 100644 --- a/addons/xterm-addon-web-links/README.md +++ b/addons/xterm-addon-web-links/README.md @@ -1,8 +1,6 @@ ## xterm-addon-web-links -[![Build Status](https://dev.azure.com/xtermjs/xterm-addon-web-links/_apis/build/status/xtermjs.xterm-addon-web-links?branchName=master)](https://dev.azure.com/xtermjs/xterm-addon-web-links/_build/latest?definitionId=5&branchName=master) - -An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enabled web links. This addon requires xterm.js 3.14+. +An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables web links. This addon requires xterm.js v4+. ### Install @@ -20,4 +18,4 @@ const terminal = new Terminal(); terminal.loadAddon(new WebLinksAddon()); ``` -You can also specify a custom handler and options, see the [API](https://github.com/xtermjs/xterm-addon-web-links/blob/master/typings/web-links.d.ts) for more details. +See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-web-links/typings/xterm-addon-web-links.d.ts) for more advanced usage. diff --git a/addons/xterm-addon-webgl/README.md b/addons/xterm-addon-webgl/README.md new file mode 100644 index 00000000..026a738e --- /dev/null +++ b/addons/xterm-addon-webgl/README.md @@ -0,0 +1,23 @@ +## xterm-addon-webgl + +An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables a WebGL-based renderer. This addon requires xterm.js v4+. + +⚠️ This is an experimental addon that is [missing some features and may be unstable](https://github.com/xtermjs/xterm.js/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Faddon%2Fwebgl) ⚠️ + +### Install + +```bash +npm install --save xterm-addon-webgl +``` + +### Usage + +```ts +import { Terminal } from 'xterm'; +import { WebglAddon } from 'xterm-addon-webgl'; + +const terminal = new Terminal(); +terminal.loadAddon(new WebglAddon()); +``` + +See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-webgl/typings/xterm-addon-webgl.d.ts) for more advanced usage. From 87c167a212d7ef0544ef4a42c0859ea66e334c5b Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 9 Sep 2019 09:32:32 -0700 Subject: [PATCH 03/10] Improve logging for addon publish --- bin/publish.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/publish.js b/bin/publish.js index 0610d116..d95ecc57 100644 --- a/bin/publish.js +++ b/bin/publish.js @@ -30,9 +30,11 @@ const addonPackageDirs = [ path.resolve(__dirname, '../addons/xterm-addon-web-links'), path.resolve(__dirname, '../addons/xterm-addon-webgl') ]; +console.log(`Checking if addons need to be published`); addonPackageDirs.forEach(p => { const addon = path.basename(p); if (changedFiles.some(e => e.indexOf(addon) !== -1)) { + console.log(`Try publish ${addon}`); checkAndPublishPackage(p); } }); From 1f12d365c8b5d34e552a7e41257dc3682dba6136 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 9 Sep 2019 10:21:37 -0700 Subject: [PATCH 04/10] Expose source maps on demo server Fixes #2258 --- demo/server.js | 5 ++--- demo/tsconfig.json | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/server.js b/demo/server.js index 8955431b..f1fae572 100644 --- a/demo/server.js +++ b/demo/server.js @@ -32,9 +32,8 @@ function startServer() { res.sendFile(__dirname + '/style.css'); }); - app.get('/dist/client-bundle.js', function(req, res){ - res.sendFile(__dirname + '/dist/client-bundle.js'); - }); + app.use('/dist', express.static(__dirname + '/dist')); + app.use('/src', express.static(__dirname + '/src')); app.post('/terminals', function (req, res) { const env = Object.assign({}, process.env); diff --git a/demo/tsconfig.json b/demo/tsconfig.json index 2bf76f67..7a53302d 100644 --- a/demo/tsconfig.json +++ b/demo/tsconfig.json @@ -9,7 +9,8 @@ "xterm-addon-attach": ["../addons/xterm-addon-attach"], "xterm-addon-fit": ["../addons/xterm-addon-fit"], "xterm-addon-search": ["../addons/xterm-addon-search"], - "xterm-addon-web-links": ["../addons/xterm-addon-web-links"] + "xterm-addon-web-links": ["../addons/xterm-addon-web-links"], + "xterm-addon-webgl": ["../addons/xterm-addon-webgl"] } }, "include": [ From b990eb42c6b57efce595005194c624e83f2408b9 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 9 Sep 2019 10:25:07 -0700 Subject: [PATCH 05/10] Fix paths in example for v4 Fixes #2146 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2853696f..498278b8 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ To start using xterm.js on your browser, add the `xterm.js` and `xterm.css` to t - - + +
From 230d26afc737b48a45ebd5691d4702c94bf99304 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 10 Sep 2019 15:54:01 -0700 Subject: [PATCH 06/10] Bump addon versions for v4 release --- addons/xterm-addon-attach/package.json | 2 +- addons/xterm-addon-fit/package.json | 2 +- addons/xterm-addon-search/package.json | 2 +- addons/xterm-addon-web-links/package.json | 2 +- addons/xterm-addon-webgl/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/xterm-addon-attach/package.json b/addons/xterm-addon-attach/package.json index 79b350e1..6a4fa464 100644 --- a/addons/xterm-addon-attach/package.json +++ b/addons/xterm-addon-attach/package.json @@ -1,6 +1,6 @@ { "name": "xterm-addon-attach", - "version": "0.1.0", + "version": "0.2.0", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" diff --git a/addons/xterm-addon-fit/package.json b/addons/xterm-addon-fit/package.json index 77471c26..03a2c1e6 100644 --- a/addons/xterm-addon-fit/package.json +++ b/addons/xterm-addon-fit/package.json @@ -1,6 +1,6 @@ { "name": "xterm-addon-fit", - "version": "0.1.0", + "version": "0.2.0", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" diff --git a/addons/xterm-addon-search/package.json b/addons/xterm-addon-search/package.json index 6871c566..4438f418 100644 --- a/addons/xterm-addon-search/package.json +++ b/addons/xterm-addon-search/package.json @@ -1,6 +1,6 @@ { "name": "xterm-addon-search", - "version": "0.1.0", + "version": "0.2.0", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" diff --git a/addons/xterm-addon-web-links/package.json b/addons/xterm-addon-web-links/package.json index 2e390690..a6240abd 100644 --- a/addons/xterm-addon-web-links/package.json +++ b/addons/xterm-addon-web-links/package.json @@ -1,6 +1,6 @@ { "name": "xterm-addon-web-links", - "version": "0.1.0", + "version": "0.2.0", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" diff --git a/addons/xterm-addon-webgl/package.json b/addons/xterm-addon-webgl/package.json index 0db5b204..378516d5 100644 --- a/addons/xterm-addon-webgl/package.json +++ b/addons/xterm-addon-webgl/package.json @@ -1,6 +1,6 @@ { "name": "xterm-addon-webgl", - "version": "0.1.0", + "version": "0.2.0", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" From e34b557f67650127b3dfbb214c6e5c3ba09d521a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 10 Sep 2019 16:29:25 -0700 Subject: [PATCH 07/10] Remove experimental flag from ITerminalAddon.activate --- typings/xterm.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index cae54dc1..d0a33cba 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -804,7 +804,7 @@ declare module 'xterm' { */ export interface ITerminalAddon extends IDisposable { /** - * (EXPERIMENTAL) This is called when the addon is activated. + * This is called when the addon is activated. */ activate(terminal: Terminal): void; } From 9a1347969241372b25ca23349930f4ce7694c1d6 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 10 Sep 2019 17:00:18 -0700 Subject: [PATCH 08/10] v4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 68467a89..f52f7b79 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "xterm", "description": "Full xterm terminal, in your browser", - "version": "3.14.0", + "version": "4.0.0", "main": "lib/xterm.js", "style": "css/xterm.css", "types": "typings/xterm.d.ts", From 7f9f75704201d44cf731287b40e6cf284652c72e Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 11 Sep 2019 14:35:36 -0700 Subject: [PATCH 09/10] Fix web links addon support in Edge regex.flags isn't supported on Edge Fixes #2417 --- src/browser/Linkifier.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/Linkifier.ts b/src/browser/Linkifier.ts index a5454ac5..53a32aa7 100644 --- a/src/browser/Linkifier.ts +++ b/src/browser/Linkifier.ts @@ -211,7 +211,7 @@ export class Linkifier implements ILinkifier { */ private _doLinkifyRow(rowIndex: number, text: string, matcher: ILinkMatcher): void { // clone regex to do a global search on text - const rex = new RegExp(matcher.regex.source, matcher.regex.flags + 'g'); + const rex = new RegExp(matcher.regex.source, (matcher.regex.flags || '') + 'g'); let match; let stringIndex = -1; while ((match = rex.exec(text)) !== null) { From e042f25b8d45ee250d1fcf9a9800053d67271420 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 11 Sep 2019 08:51:01 -0700 Subject: [PATCH 10/10] Expose ctor at window.Terminal Fixes #2415 --- webpack.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 3f55dda3..a9a60241 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -35,7 +35,6 @@ module.exports = { output: { filename: 'xterm.js', path: path.resolve('./lib'), - library: 'Terminal', libraryTarget: 'umd' }, mode: 'production'