Merge remote-tracking branch 'upstream/master' into 335_viewport_var

This commit is contained in:
Daniel Imms
2017-01-10 20:03:19 -08:00
2 changed files with 23 additions and 10 deletions
+7 -2
View File
@@ -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
+16 -8
View File
@@ -321,7 +321,8 @@ Terminal.defaults = {
scrollback: 1000,
screenKeys: false,
debug: false,
cancelEvents: false
cancelEvents: false,
disableStdin: false
// programFeatures: false,
// focusKeys: false,
};
@@ -1252,6 +1253,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?
@@ -1266,13 +1276,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 {
@@ -3154,6 +3157,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();