Merge branch 'master' into fix-typings

This commit is contained in:
Daniel Imms
2018-01-18 11:56:10 -08:00
committed by GitHub
6 changed files with 39 additions and 45 deletions
-1
View File
@@ -1,7 +1,6 @@
language: node_js language: node_js
os: os:
- linux - linux
- osx
node_js: node_js:
- 6 - 6
before_install: before_install:
+2
View File
@@ -120,6 +120,8 @@ computational environment for Jupyter, supporting interactive data science and s
- [**VTerm**](https://github.com/vterm/vterm): Extensible terminal emulator based on Electron and React. - [**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. - [**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. - [**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. 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.
+30 -43
View File
@@ -18,11 +18,13 @@ const ts = require('gulp-typescript');
const util = require('gulp-util'); const util = require('gulp-util');
const webpack = require('webpack-stream'); const webpack = require('webpack-stream');
let buildDir = process.env.BUILD_DIR || 'build'; const buildDir = process.env.BUILD_DIR || 'build';
let tsProject = ts.createProject('tsconfig.json'); const tsProject = ts.createProject('tsconfig.json');
let srcDir = tsProject.config.compilerOptions.rootDir; const srcDir = tsProject.config.compilerOptions.rootDir;
let outDir = tsProject.config.compilerOptions.outDir; 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 // Under some environments like TravisCI, this comes out at absolute which can
// break the build. This ensures that the outDir is absolute. // break the build. This ensures that the outDir is absolute.
if (path.normalize(outDir).indexOf(__dirname) !== 0) { 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)) 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) { let addonStreams = addons.map(function(addon) {
fs.emptyDirSync(`${outDir}/addons/${addon}`); fs.emptyDirSync(`${outDir}/addons/${addon}`);
@@ -108,45 +109,29 @@ gulp.task('browserify', ['tsc'], function() {
}); });
gulp.task('browserify-addons', ['tsc'], function() { gulp.task('browserify-addons', ['tsc'], function() {
let searchOptions = { const bundles = addons.map((addon) => {
basedir: `${buildDir}/addons/search`, const addonOptions = {
debug: true, basedir: `${buildDir}/addons/${addon}`,
entries: [`${outDir}/addons/search/search.js`], debug: true,
cache: {}, entries: [`${outDir}/addons/${addon}/${addon}.js`],
packageCache: {} standalone: addon,
}; cache: {},
let searchBundle = browserify(searchOptions) packageCache: {}
.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));
let winptyCompatOptions = { const addonBundle = browserify(addonOptions)
basedir: `${buildDir}/addons/winptyCompat`, .external(path.join(outDir, 'Terminal.js'))
debug: true, .bundle()
entries: [`${outDir}/addons/winptyCompat/winptyCompat.js`], .pipe(source(`./addons/${addon}/${addon}.js`))
cache: {}, .pipe(buffer())
packageCache: {} .pipe(sourcemaps.init({loadMaps: true, sourceRoot: ''}))
}; .pipe(sourcemaps.write('./'))
let winptyCompatBundle = browserify(winptyCompatOptions) .pipe(gulp.dest(buildDir));
.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));
// Copy all add-ons from outDir to buildDir return addonBundle;
let copyAddons = gulp.src([ });
// Copy JS addons
`${outDir}/addons/**/*`
]).pipe(gulp.dest(`${buildDir}/addons`));
return merge(searchBundle, winptyCompatBundle, copyAddons); return merge(...bundles);
}); });
gulp.task('instrument-test', function () { gulp.task('instrument-test', function () {
@@ -194,9 +179,11 @@ gulp.task('sorcery', ['browserify'], function () {
}); });
gulp.task('sorcery-addons', ['browserify-addons'], function () { gulp.task('sorcery-addons', ['browserify-addons'], function () {
var chain = sorcery.loadSync(`${buildDir}/addons/search/search.js`); addons.forEach((addon) => {
chain.apply(); const chain = sorcery.loadSync(`${buildDir}/addons/${addon}/${addon}.js`);
chain.writeSync(); chain.apply();
chain.writeSync();
})
}); });
gulp.task('webpack', ['build'], function() { gulp.task('webpack', ['build'], function() {
+4
View File
@@ -1573,6 +1573,8 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
// page up // page up
if (ev.shiftKey) { if (ev.shiftKey) {
result.scrollLines = -(this.rows - 1); result.scrollLines = -(this.rows - 1);
} else if (modifiers) {
result.key = C0.ESC + '[5;' + (modifiers + 1) + '~';
} else { } else {
result.key = C0.ESC + '[5~'; result.key = C0.ESC + '[5~';
} }
@@ -1581,6 +1583,8 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
// page down // page down
if (ev.shiftKey) { if (ev.shiftKey) {
result.scrollLines = this.rows - 1; result.scrollLines = this.rows - 1;
} else if (modifiers) {
result.key = C0.ESC + '[6;' + (modifiers + 1) + '~';
} else { } else {
result.key = C0.ESC + '[6~'; result.key = C0.ESC + '[6~';
} }
+2 -1
View File
@@ -108,9 +108,10 @@ export class CursorRenderLayer extends BaseRenderLayer {
} }
public onGridChanged(terminal: ITerminal, startRow: number, endRow: number): void { public onGridChanged(terminal: ITerminal, startRow: number, endRow: number): void {
// Only render if the animation frame is not active
if (!this._cursorBlinkStateManager || this._cursorBlinkStateManager.isPaused) { if (!this._cursorBlinkStateManager || this._cursorBlinkStateManager.isPaused) {
this._render(terminal, false); this._render(terminal, false);
} else {
this._cursorBlinkStateManager.restartBlinkAnimation(terminal);
} }
} }
+1
View File
@@ -57,6 +57,7 @@ export class Renderer extends EventEmitter implements IRenderer {
}; };
this._devicePixelRatio = window.devicePixelRatio; this._devicePixelRatio = window.devicePixelRatio;
this._updateDimensions(); this._updateDimensions();
this.onOptionsChanged();
this._screenDprMonitor = new ScreenDprMonitor(); this._screenDprMonitor = new ScreenDprMonitor();
this._screenDprMonitor.setListener(() => this.onWindowResize(window.devicePixelRatio)); this._screenDprMonitor.setListener(() => this.onWindowResize(window.devicePixelRatio));