mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-11 03:25:45 +00:00
fix CHA, fix SU and SD.
This commit is contained in:
parent
5c114b8b69
commit
7b7330ec5a
@ -1895,7 +1895,7 @@ Program.prototype.cursorCharAbsolute = function(param) {
|
||||
this.x = param;
|
||||
this.y = 0;
|
||||
this._ncoords();
|
||||
if (this.tput) return this.put.cha(param);
|
||||
if (this.tput) return this.put.hpa(param);
|
||||
return this.write('\x1b[' + (param + 1) + 'G');
|
||||
};
|
||||
|
||||
@ -1933,7 +1933,6 @@ Program.prototype.eraseChars = function(param) {
|
||||
|
||||
// CSI Pm ` Character Position Absolute
|
||||
// [column] (default = [row,1]) (HPA).
|
||||
// NOTE: Can't find in terminfo, no idea why it has multiple params.
|
||||
Program.prototype.hpa =
|
||||
Program.prototype.charPosAbsolute = function(param) {
|
||||
this.x = param || 0;
|
||||
@ -2137,11 +2136,7 @@ Program.prototype.HVPosition = function(row, col) {
|
||||
// http://vt100.net/docs/vt220-rm/chapter4.html
|
||||
Program.prototype.sm =
|
||||
Program.prototype.setMode = function() {
|
||||
// tput: TODO
|
||||
var param = Array.prototype.slice.call(arguments).join(';');
|
||||
//if (private) {
|
||||
// return this.write('\x1b[?' + (param || '') + 'h');
|
||||
//}
|
||||
return this.write('\x1b[' + (param || '') + 'h');
|
||||
};
|
||||
|
||||
@ -2171,8 +2166,6 @@ Program.prototype.alternateBuffer = function() {
|
||||
this.isAlt = true;
|
||||
if (this.tput) return this.put.smcup();
|
||||
if (this.term('vt') || this.term('linux')) return;
|
||||
//return this.setMode('?47');
|
||||
//return this.setMode('?1047');
|
||||
return this.setMode('?1049');
|
||||
};
|
||||
|
||||
@ -2258,11 +2251,7 @@ Program.prototype.alternateBuffer = function() {
|
||||
// Ps = 2 0 0 4 -> Reset bracketed paste mode.
|
||||
Program.prototype.rm =
|
||||
Program.prototype.resetMode = function() {
|
||||
// tput: TODO
|
||||
var param = Array.prototype.slice.call(arguments).join(';');
|
||||
//if (private) {
|
||||
// return this.write('\x1b[?' + (param || '') + 'l');
|
||||
//}
|
||||
return this.write('\x1b[' + (param || '') + 'l');
|
||||
};
|
||||
|
||||
@ -2284,8 +2273,6 @@ Program.prototype.hideCursor = function() {
|
||||
Program.prototype.rmcup =
|
||||
Program.prototype.normalBuffer = function() {
|
||||
this.isAlt = false;
|
||||
//return this.resetMode('?47');
|
||||
//return this.resetMode('?1047');
|
||||
if (this.tput) return this.put.rmcup();
|
||||
return this.resetMode('?1049');
|
||||
};
|
||||
@ -2466,9 +2453,7 @@ Program.prototype.cht =
|
||||
Program.prototype.cursorForwardTab = function(param) {
|
||||
this.x += 8;
|
||||
this._ncoords();
|
||||
// Does not exist (?):
|
||||
// if (this.tput) return this.put.cht(param);
|
||||
if (this.tput) return this.put.tab(param); // or this.put.ht
|
||||
if (this.tput) return this.put.tab(param);
|
||||
return this.write('\x1b[' + (param || 1) + 'I');
|
||||
};
|
||||
|
||||
@ -2477,10 +2462,8 @@ Program.prototype.su =
|
||||
Program.prototype.scrollUp = function(param) {
|
||||
this.y -= param || 1;
|
||||
this._ncoords();
|
||||
// Does not exist:
|
||||
// if (this.tput) return this.put.su(param);
|
||||
if (this.tput) return this.put.rin(param);
|
||||
return this.write('\x1b[' + (param || 1) + 'I');
|
||||
if (this.tput) return this.put.parm_index(param);
|
||||
return this.write('\x1b[' + (param || 1) + 'S');
|
||||
};
|
||||
|
||||
// CSI Ps T Scroll down Ps lines (default = 1) (SD).
|
||||
@ -2488,9 +2471,7 @@ Program.prototype.sd =
|
||||
Program.prototype.scrollDown = function(param) {
|
||||
this.y += param || 1;
|
||||
this._ncoords();
|
||||
// Does not exist:
|
||||
// if (this.tput) return this.put.sd(param);
|
||||
if (this.tput) return this.put.indn(param);
|
||||
if (this.tput) return this.put.parm_rindex(param);
|
||||
return this.write('\x1b[' + (param || 1) + 'T');
|
||||
};
|
||||
|
||||
@ -2529,8 +2510,8 @@ Program.prototype.cursorBackwardTab = function(param) {
|
||||
// CSI Ps b Repeat the preceding graphic character Ps times (REP).
|
||||
Program.prototype.rep =
|
||||
Program.prototype.repeatPrecedingCharacter = function(param) {
|
||||
//this.x += param || 1;
|
||||
//this._ncoords();
|
||||
this.x += param || 1;
|
||||
this._ncoords();
|
||||
if (this.tput) return this.put.rep(param);
|
||||
return this.write('\x1b[' + (param || 1) + 'b');
|
||||
};
|
||||
@ -2560,10 +2541,6 @@ Program.prototype.tabClear = function(param) {
|
||||
// Ps = 1 1 -> Print all pages.
|
||||
Program.prototype.mc =
|
||||
Program.prototype.mediaCopy = function() {
|
||||
//if (dec) {
|
||||
// this.write('\x1b[?' + Array.prototype.slice.call(arguments).join(';') + 'i');
|
||||
// return;
|
||||
//}
|
||||
return this.write('\x1b[' + Array.prototype.slice.call(arguments).join(';') + 'i');
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user