mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
improve wide char support.
This commit is contained in:
@@ -66,6 +66,17 @@ app.use(express.static(__dirname + '/../lib'));
|
||||
|
||||
server.listen(8080);
|
||||
|
||||
server.on('connection', function(socket) {
|
||||
var address = socket.remoteAddress;
|
||||
if (address !== '127.0.0.1' && address !== '::1') {
|
||||
try {
|
||||
socket.destroy();
|
||||
} catch (e) {
|
||||
;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Sockets
|
||||
*/
|
||||
|
||||
+15
-4
@@ -1029,7 +1029,7 @@ Terminal.prototype.refresh = function(start, end) {
|
||||
if (ch <= ' ') {
|
||||
out += ' ';
|
||||
} else {
|
||||
// if (dwidthChars.test(ch)) i++;
|
||||
// if (wideChars.test(ch)) i++;
|
||||
out += ch;
|
||||
}
|
||||
break;
|
||||
@@ -1138,7 +1138,7 @@ Terminal.prototype.write = function(data) {
|
||||
, ch;
|
||||
|
||||
// If we want to remove double-width chars entirely.
|
||||
// data = data.replace(dwidthChars, '?');
|
||||
// data = data.replace(wideChars, '?');
|
||||
|
||||
this.refreshStart = this.y;
|
||||
this.refreshEnd = this.y;
|
||||
@@ -1231,7 +1231,18 @@ Terminal.prototype.write = function(data) {
|
||||
this.lines[this.y + this.ybase][this.x] = [this.curAttr, ch];
|
||||
this.x++;
|
||||
this.updateRange(this.y);
|
||||
// if (dwidthChars.test(ch)) this.x++;
|
||||
|
||||
// if (wideChars.test(ch)) {
|
||||
// if (this.cols < 2) {
|
||||
// this.lines[this.y + this.ybase][this.x - 1][1] = ' ';
|
||||
// break;
|
||||
// }
|
||||
// this.x++;
|
||||
// if (this.x >= this.cols) {
|
||||
// this.lines[this.y + this.ybase][this.x - 2][1] = ' ';
|
||||
// // Do something like: this.write(ch);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -4372,7 +4383,7 @@ function indexOf(obj, el) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var dwidthChars = new RegExp('(['
|
||||
var wideChars = new RegExp('(['
|
||||
+ '\\uff01-\\uffbe'
|
||||
+ '\\uffc2-\\uffc7'
|
||||
+ '\\uffca-\\uffcf'
|
||||
|
||||
Reference in New Issue
Block a user