From c3f46e4a6b244b043eda721e8d9714b618897721 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 31 Dec 2016 07:05:06 -0800 Subject: [PATCH 1/3] Fix scroll in tmux with max scrollback I believe this is related to when scrollBottom is not the last row in the viewport Fixes #434 --- src/xterm.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index 1d220652..6fddd111 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -1234,6 +1234,15 @@ Terminal.prototype.showCursor = function() { Terminal.prototype.scroll = function() { var row; + // Make room for the new row in lines + if (this.lines.length === this.lines.maxLength) { + this.lines.trimStart(1); + this.ybase--; + if (this.ydisp !== 0) { + this.ydisp--; + } + } + this.ybase++; // TODO: Why is this done twice? @@ -1248,13 +1257,6 @@ Terminal.prototype.scroll = function() { row -= this.rows - 1 - this.scrollBottom; if (row === this.lines.length) { - // Compensate ybase and ydisp if lines has hit the maximum buffer size - if (this.lines.length === this.lines.maxLength) { - this.ybase--; - if (this.ydisp !== 0) { - this.ydisp--; - } - } // Optimization: pushing is faster than splicing when they amount to the same behavior this.lines.push(this.blankLine()); } else { From d9d60063d788308c98a2809e6b5086e64aa27bcc Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 4 Jan 2017 12:43:21 -0800 Subject: [PATCH 2/3] Add disableStdin option Fixes #452 --- src/xterm.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index 1d220652..78c07609 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -326,7 +326,8 @@ Terminal.defaults = { scrollback: 1000, screenKeys: false, debug: false, - cancelEvents: false + cancelEvents: false, + disableStdin: false // programFeatures: false, // focusKeys: false, }; @@ -3134,6 +3135,11 @@ Terminal.prototype.is = function(term) { * @param {string} data The data to populate in the event. */ Terminal.prototype.handler = function(data) { + // Prevents all events to pty process if stdin is disabled + if (this.options.disableStdin) { + return; + } + // Input is being sent to the terminal, the terminal should focus the prompt. if (this.ybase !== this.ydisp) { this.scrollToBottom(); From 6c29ccfbd1ffc90ceca07130868322b5004af13a Mon Sep 17 00:00:00 2001 From: Tyler Jewell Date: Sun, 8 Jan 2017 17:41:02 -0800 Subject: [PATCH 3/3] Add Codenvy to the list of xTerm supporters --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 608c48ac..f68da0f1 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ Xterm.js is used in several world-class applications to provide great terminal e - [**Microsoft Visual Studio Code**](http://code.visualstudio.com/): Modern, versatile and powerful open source code editor that provides an integrated terminal based on xterm.js - [**ttyd**](https://github.com/tsl0922/ttyd): A command-line tool for sharing terminal over the web, with fully-featured terminal emulation based on xterm.js - [**Katacoda**](https://www.katacoda.com/): Katacoda is an Interactive Learning Platform for software developers, covering the latest Cloud Native technologies. -- [**Eclipse Che**](http://www.eclipse.org/che): Developer workspace server, cloud IDE, and Eclipse next-generation IDE +- [**Eclipse Che**](http://www.eclipse.org/che): Developer workspace server, cloud IDE, and Eclipse next-generation IDE. +- [**Codenvy**](http://www.codenvy.com): Cloud workspaces for development teams. 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. @@ -120,7 +121,11 @@ Visit https://lair.io/sourcelair/xterm and follow the instructions. All developm #### [Eclipse Che](http://www.eclipse.org/che) -You can start Eclipse Che with `docker run eclipse/che start` +You can start Eclipse Che with `docker run eclipse/che start`. + +#### [Codenvy](http://www.codenvy.io) + +You can create a trial account or install an enterprise version with `docker run codenvy/cli start`. ## License Agreement