Skip to content

Instantly share code, notes, and snippets.

@jerch
Last active June 21, 2016 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerch/4393f100562b602ee1cc030cc9fa1f63 to your computer and use it in GitHub Desktop.
Save jerch/4393f100562b602ee1cc030cc9fa1f63 to your computer and use it in GitHub Desktop.
xterm.js with fast keyboard input
diff --git a/demo/app.js b/demo/app.js
index c48f609..c7606ab 100644
--- a/demo/app.js
+++ b/demo/app.js
@@ -31,6 +31,7 @@ app.ws('/bash', function(ws, req) {
});
term.on('data', function(data) {
try {
+ term.write('\x13');
ws.send(data);
} catch (ex) {
// The WebSocket is not open, ignore
diff --git a/src/xterm.js b/src/xterm.js
index 30ec970..3628981 100644
--- a/src/xterm.js
+++ b/src/xterm.js
@@ -1458,6 +1458,8 @@
* @public
*/
Terminal.prototype.write = function(data) {
+ this.send('\x11');
+
var l = data.length, i = 0, j, cs, ch;
this.refreshStart = this.y;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment