workaropund: allow forced mouse protocol via env
This commit is contained in:
parent
db435b179d
commit
fc227ed503
|
@ -2818,6 +2818,39 @@ Program.prototype.normalBuffer = function() {
|
|||
};
|
||||
|
||||
Program.prototype.enableMouse = function() {
|
||||
console.log(process.env.BLESSED_FORCE_MODES);
|
||||
if (process.env.BLESSED_FORCE_MODES) {
|
||||
var modes=process.env.BLESSED_FORCE_MODES.split(',');
|
||||
var options={};
|
||||
for (var n=0; n<modes.length; ++n) {
|
||||
var mds=modes[n].split('=');
|
||||
var v=mds[1]=='0' ? false : true;
|
||||
switch(mds[0].toUpperCase()) {
|
||||
case 'SGRMOUSE':
|
||||
options.sgrMouse=v; break;
|
||||
case 'UTFMOUSE':
|
||||
options.utfMouse=v; break;
|
||||
case 'VT200MOUSE':
|
||||
options.vt200Mouse=v; break;
|
||||
case 'URXVTMOUSE':
|
||||
options.urxvtMouse=true; break;
|
||||
case 'X10MOUSE':
|
||||
options.x10Mouse=true; break;
|
||||
case 'GPMMOUSE':
|
||||
this.enableGpm();
|
||||
break;
|
||||
case 'CELLMOTION':
|
||||
options.cellMotion=v; break;
|
||||
case 'ALLMOTION':
|
||||
options.allMotion=v; break;
|
||||
case 'SENDFOCUS':
|
||||
options.sendFocus=v; break;
|
||||
}
|
||||
}
|
||||
console.log(options);
|
||||
return this.setMouse(options, true);
|
||||
}
|
||||
|
||||
if (this.term('rxvt-unicode') || process.env.VTE_VERSION) {
|
||||
return this.setMouse({
|
||||
urxvtMouse: true,
|
||||
|
|
Loading…
Reference in New Issue