mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
v0.0.1
This commit is contained in:
@@ -10,6 +10,7 @@ Server:
|
||||
``` js
|
||||
var term = require('term.js');
|
||||
express.use(term.middleware());
|
||||
...
|
||||
```
|
||||
|
||||
Client:
|
||||
@@ -27,6 +28,10 @@ window.addEventListener('load', function() {
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
term.on('title', function(title) {
|
||||
console.log('New title: ' + title);
|
||||
});
|
||||
|
||||
term.write('\x1b[41hello world\x1b[m');
|
||||
}, false);
|
||||
```
|
||||
@@ -34,5 +39,3 @@ window.addEventListener('load', function() {
|
||||
## License
|
||||
|
||||
Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
|
||||
[1]: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Mouse%20Tracking
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* term.js - an xterm emulator
|
||||
* Copyright (c) 2013, Christopher Jeffrey (MIT License)
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* https://github.com/chjj/term.js
|
||||
*/
|
||||
|
||||
|
||||
+12
@@ -1104,6 +1104,8 @@ Terminal.prototype.scrollDisp = function(disp) {
|
||||
};
|
||||
|
||||
Terminal.prototype.write = function(data) {
|
||||
// data = data.replace(dwidthChars, '?');
|
||||
|
||||
var l = data.length
|
||||
, i = 0
|
||||
, cs
|
||||
@@ -4336,6 +4338,16 @@ function indexOf(obj, el) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var dwidthChars = new RegExp('(['
|
||||
+ '\\uff01-\\uffbe'
|
||||
+ '\\uffc2-\\uffc7'
|
||||
+ '\\uffca-\\uffcf'
|
||||
+ '\\uffd2-\\uffd7'
|
||||
+ '\\uffda-\\uffdc'
|
||||
+ '\\uffe0-\\uffe6'
|
||||
+ '\\uffe8-\\uffee'
|
||||
+ '])', 'g');
|
||||
|
||||
/**
|
||||
* Expose
|
||||
*/
|
||||
|
||||
+6
-1
@@ -10,5 +10,10 @@
|
||||
"bugs": { "url": "https://github.com/chjj/term.js/issues" },
|
||||
"keywords": ["tty", "terminal", "term"],
|
||||
"tags": ["tty", "terminal", "term"],
|
||||
"engines": { "node": ">= 0.8.0" }
|
||||
"engines": { "node": ">= 0.8.0" },
|
||||
"devDependencies": {
|
||||
"express": "3.1.0",
|
||||
"socket.io": "0.9.13",
|
||||
"pty.js": "0.2.3"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,6 +20,6 @@ app.use(function(req, res, next) {
|
||||
|
||||
app.use(express.static(__dirname));
|
||||
|
||||
app.use(express.static(__dirname + '/../static'));
|
||||
app.use(express.static(__dirname + '/../lib'));
|
||||
|
||||
app.listen(8080);
|
||||
|
||||
Reference in New Issue
Block a user