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

v0.7.4-release
Brian 2010-08-23 08:15:16 -04:00 committed by Ryan Dahl
parent 6078c37be5
commit d9eb64928e
1 changed files with 4 additions and 2 deletions

View File

@ -389,12 +389,14 @@ Interface.prototype._ttyWrite = function (b) {
}
} else if ((b[1] === 91 && 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._refreshLine();
} else if ((b[1] === 91 && 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._refreshLine();
} else if (b[1] === 91 && b[2] === 65) { // up arrow