Browse Source

Fix home/end keys in repl for putty/xterm.

v0.7.4-release
Brian 15 years ago
committed by Ryan Dahl
parent
commit
d9eb64928e
  1. 6
      lib/readline.js

6
lib/readline.js

@ -389,12 +389,14 @@ Interface.prototype._ttyWrite = function (b) {
} }
} else if ((b[1] === 91 && b[2] === 72) || } else if ((b[1] === 91 && b[2] === 72) ||
(b[1] === 79 && b[2] === 72) || (b[1] === 79 && b[2] === 72) ||
(b[1] === 91 && b[2] === 55)) { // home (b[1] === 91 && b[2] === 55) ||
(b[1] === 91 && b[2] === 49 && (b[3] && b[3] === 126))) { // home
this.cursor = 0; this.cursor = 0;
this._refreshLine(); this._refreshLine();
} else if ((b[1] === 91 && b[2] === 70) || } else if ((b[1] === 91 && b[2] === 70) ||
(b[1] === 79 && b[2] === 70) || (b[1] === 79 && b[2] === 70) ||
(b[1] === 91 && b[2] === 56)) { // end (b[1] === 91 && b[2] === 56) ||
(b[1] === 91 && b[2] === 52 && (b[3] && b[3] === 126))) { // end
this.cursor = this.line.length; this.cursor = this.line.length;
this._refreshLine(); this._refreshLine();
} else if (b[1] === 91 && b[2] === 65) { // up arrow } else if (b[1] === 91 && b[2] === 65) { // up arrow

Loading…
Cancel
Save