From b7c0ca11fe8340f1baead1e954092131e11eb3b3 Mon Sep 17 00:00:00 2001 From: ficristo Date: Sun, 7 Jan 2018 09:02:41 +0100 Subject: [PATCH 1/4] Make addons UMD compatible --- gulpfile.js | 73 ++++++++++++++++++++++------------------------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 49d67ed6..4a4be8b0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -18,11 +18,13 @@ const ts = require('gulp-typescript'); const util = require('gulp-util'); const webpack = require('webpack-stream'); -let buildDir = process.env.BUILD_DIR || 'build'; -let tsProject = ts.createProject('tsconfig.json'); -let srcDir = tsProject.config.compilerOptions.rootDir; +const buildDir = process.env.BUILD_DIR || 'build'; +const tsProject = ts.createProject('tsconfig.json'); +const srcDir = tsProject.config.compilerOptions.rootDir; let outDir = tsProject.config.compilerOptions.outDir; +const addons = ['attach', 'fit', 'fullscreen', 'search', 'terminado', 'winptyCompat', 'zmodem']; + // Under some environments like TravisCI, this comes out at absolute which can // break the build. This ensures that the outDir is absolute. if (path.normalize(outDir).indexOf(__dirname) !== 0) { @@ -45,7 +47,6 @@ gulp.task('tsc', function () { tsResult.dts.pipe(sourcemaps.write('.', {includeContent: false, sourceRoot: ''})).pipe(gulp.dest(outDir)) ); - let addons = ['attach', 'fit', 'fullscreen', 'search', 'terminado', 'winptyCompat', 'zmodem']; let addonStreams = addons.map(function(addon) { fs.emptyDirSync(`${outDir}/addons/${addon}`); @@ -103,45 +104,29 @@ gulp.task('browserify', ['tsc'], function() { }); gulp.task('browserify-addons', ['tsc'], function() { - let searchOptions = { - basedir: `${buildDir}/addons/search`, - debug: true, - entries: [`${outDir}/addons/search/search.js`], - cache: {}, - packageCache: {} - }; - let searchBundle = browserify(searchOptions) - .external(path.join(outDir, 'Terminal.js')) - .bundle() - .pipe(source('./addons/search/search.js')) - .pipe(buffer()) - .pipe(sourcemaps.init({loadMaps: true, sourceRoot: ''})) - .pipe(sourcemaps.write('./')) - .pipe(gulp.dest(buildDir)); + const bundles = addons.map((addon) => { + const addonOptions = { + basedir: `${buildDir}/addons/${addon}`, + debug: true, + entries: [`${outDir}/addons/${addon}/${addon}.js`], + standalone: addon, + cache: {}, + packageCache: {} + }; - let winptyCompatOptions = { - basedir: `${buildDir}/addons/winptyCompat`, - debug: true, - entries: [`${outDir}/addons/winptyCompat/winptyCompat.js`], - cache: {}, - packageCache: {} - }; - let winptyCompatBundle = browserify(winptyCompatOptions) - .external(path.join(outDir, 'Terminal.js')) - .bundle() - .pipe(source('./addons/winptyCompat/winptyCompat.js')) - .pipe(buffer()) - .pipe(sourcemaps.init({loadMaps: true, sourceRoot: ''})) - .pipe(sourcemaps.write('./')) - .pipe(gulp.dest(buildDir)); + const addonBundle = browserify(addonOptions) + .external(path.join(outDir, 'Terminal.js')) + .bundle() + .pipe(source(`./addons/${addon}/${addon}.js`)) + .pipe(buffer()) + .pipe(sourcemaps.init({loadMaps: true, sourceRoot: ''})) + .pipe(sourcemaps.write('./')) + .pipe(gulp.dest(buildDir)); - // Copy all add-ons from outDir to buildDir - let copyAddons = gulp.src([ - // Copy JS addons - `${outDir}/addons/**/*` - ]).pipe(gulp.dest(`${buildDir}/addons`)); + return addonBundle; + }); - return merge(searchBundle, winptyCompatBundle, copyAddons); + return merge(...bundles); }); gulp.task('instrument-test', function () { @@ -189,9 +174,11 @@ gulp.task('sorcery', ['browserify'], function () { }); gulp.task('sorcery-addons', ['browserify-addons'], function () { - var chain = sorcery.loadSync(`${buildDir}/addons/search/search.js`); - chain.apply(); - chain.writeSync(); + addons.forEach((addon) => { + const chain = sorcery.loadSync(`${buildDir}/addons/${addon}/${addon}.js`); + chain.apply(); + chain.writeSync(); + }) }); gulp.task('webpack', ['build'], function() { From 5a147f201f476cc59947d51194dc09b6f9c6466c Mon Sep 17 00:00:00 2001 From: Justin Luk Date: Fri, 12 Jan 2018 15:13:19 -0800 Subject: [PATCH 2/4] Include cloud shell in xterm applications --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1719efb2..2cf99749 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ computational environment for Jupyter, supporting interactive data science and s - [**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. - [**Kubebox**](https://github.com/astefanutti/kubebox): Terminal console for Kubernetes clusters. +- [**Azure Cloud Shell**](https://shell.azure.com): Azure Cloud Shell is a Microsoft-managed admin machine built on Azure, for Azure. 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. From a7101b5bcb89870f7620e352551d6c03f6643928 Mon Sep 17 00:00:00 2001 From: Andres Mejia Date: Sat, 13 Jan 2018 15:34:05 -0500 Subject: [PATCH 3/4] Add use case for atom-xterm. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2cf99749..93e7f262 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ computational environment for Jupyter, supporting interactive data science and s - [**electerm**](http://electerm.html5beta.com): electerm is a terminal/ssh/sftp client(mac, win, linux) based on electron/node-pty/xterm. - [**Kubebox**](https://github.com/astefanutti/kubebox): Terminal console for Kubernetes clusters. - [**Azure Cloud Shell**](https://shell.azure.com): Azure Cloud Shell is a Microsoft-managed admin machine built on Azure, for Azure. +- [**atom-xterm**](https://atom.io/packages/atom-xterm): Atom plugin for providing terminals inside your Atom workspace. 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. From 80f13792a375002a0d7154b92d38ff3acea67ead Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 16 Jan 2018 06:34:22 -0800 Subject: [PATCH 4/4] Ensure renderer uses latest options at open Fixes #1194 --- src/renderer/Renderer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/Renderer.ts b/src/renderer/Renderer.ts index 31547da4..680d9490 100644 --- a/src/renderer/Renderer.ts +++ b/src/renderer/Renderer.ts @@ -57,6 +57,7 @@ export class Renderer extends EventEmitter implements IRenderer { }; this._devicePixelRatio = window.devicePixelRatio; this._updateDimensions(); + this.onOptionsChanged(); this._screenDprMonitor = new ScreenDprMonitor(); this._screenDprMonitor.setListener(() => this.onWindowResize(window.devicePixelRatio));