diff --git a/lib/program.js b/lib/program.js index 5a5b152..e2057b0 100644 --- a/lib/program.js +++ b/lib/program.js @@ -633,7 +633,7 @@ Program.prototype._bindMouse = function(s, buf) { } }; -/* gpm support for linux vc */ +// gpm support for linux vc Program.prototype.enableGpm = function() { var self = this; var gpmclient = require('./gpmclient') @@ -2797,7 +2797,7 @@ Program.prototype.enableMouse = function() { options.x10Mouse = v; break; case 'GPMMOUSE': - this.enableGpm(); + options.gpmMouse = v; break; case 'CELLMOTION': options.cellMotion = v; @@ -2839,9 +2839,9 @@ Program.prototype.enableMouse = function() { } if (this.term('linux')) { - this.enableGpm(); return this.setMouse({ - vt200Mouse: true + vt200Mouse: true, + gpmMouse: true }, true); } @@ -2865,7 +2865,6 @@ Program.prototype.disableMouse = function() { obj[key] = false; }); - this.disableGpm(); return this.setMouse(obj, false); }; @@ -2962,6 +2961,12 @@ Program.prototype.setMouse = function(opt, enable) { if (opt.urxvtMouse) this.setMode('?1015'); else this.resetMode('?1015'); } + + // gpm mouse + if (opt.gpmMouse != null) { + if (opt.gpmMouse) this.enableGpm(); + else this.disableGpm(); + } }; // CSI Ps ; Ps r