mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-09 18:45:51 +00:00
more vte+rxvt cleanup. see #89.
This commit is contained in:
parent
3cdcc7a64b
commit
37f2313979
@ -387,24 +387,6 @@ Program.prototype._bindMouse = function(s, buf) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isVTE && (parts = /^\x1b\[M([\u0000-\uffff]{3})/.exec(s))) {
|
|
||||||
var b = parts[1].charCodeAt(0)
|
|
||||||
, x = parts[1].charCodeAt(1)
|
|
||||||
, y = parts[1].charCodeAt(2)
|
|
||||||
, mod;
|
|
||||||
|
|
||||||
if (x >= 65533) x = buf[4];
|
|
||||||
if (y >= 65533) y = buf[5];
|
|
||||||
|
|
||||||
// if libvte goes over 255, it sends this.
|
|
||||||
// if (x > 0x00 && x < 0x20) x += 223;
|
|
||||||
// if (y > 0x00 && y < 0x20) y += 223;
|
|
||||||
|
|
||||||
s = '\x1b[M' + parts[1][0]
|
|
||||||
+ String.fromCharCode(x)
|
|
||||||
+ String.fromCharCode(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
// XTerm / X10
|
// XTerm / X10
|
||||||
if (parts = /^\x1b\[M([\x00\u0020-\uffff]{3})/.exec(s)) {
|
if (parts = /^\x1b\[M([\x00\u0020-\uffff]{3})/.exec(s)) {
|
||||||
var b = parts[1].charCodeAt(0)
|
var b = parts[1].charCodeAt(0)
|
||||||
@ -2672,11 +2654,16 @@ Program.prototype.enableMouse = function() {
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// libvte is broken
|
// rxvt does not support the X10 UTF extensions
|
||||||
// NOTE: The old version of vte xfce-term uses
|
if (this.term('rxvt')) {
|
||||||
// doesn't support the urxvt or sgr mouse protocols.
|
return this.setMouse({
|
||||||
// However, it seems to have supported SGR events before URXVT events. We'll
|
x10Mouse: true,
|
||||||
// stick to that and hope people are using the latest VTE.
|
allMotion: true
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// libvte is broken, older versions do not support the
|
||||||
|
// X10 UTF extension, later versions do support SGR however
|
||||||
if (this.isVTE) {
|
if (this.isVTE) {
|
||||||
return this.setMouse({
|
return this.setMouse({
|
||||||
sgrMouse: true,
|
sgrMouse: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user