fix ECH
This commit is contained in:
@@ -1048,6 +1048,20 @@ describe('InputHandler', () => {
|
|||||||
term.writeSync('0123456789\x1b[P');
|
term.writeSync('0123456789\x1b[P');
|
||||||
assert.equal(term.buffer.lines.get(0).translateToString(false), '012345678 ');
|
assert.equal(term.buffer.lines.get(0).translateToString(false), '012345678 ');
|
||||||
});
|
});
|
||||||
|
it('ECH', () => {
|
||||||
|
term.buffer.x = 10000;
|
||||||
|
term.buffer.y = 10000;
|
||||||
|
term.writeSync('\x1b[X');
|
||||||
|
assert.deepEqual(getCursor(term), [9, 9]);
|
||||||
|
term.buffer.x = -10000;
|
||||||
|
term.buffer.y = -10000;
|
||||||
|
term.writeSync('\x1b[X');
|
||||||
|
assert.deepEqual(getCursor(term), [0, 0]);
|
||||||
|
});
|
||||||
|
it('ECH - should delete last cell', () => {
|
||||||
|
term.writeSync('0123456789\x1b[X');
|
||||||
|
assert.equal(term.buffer.lines.get(0).translateToString(false), '012345678 ');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+10
-6
@@ -950,12 +950,16 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|||||||
* Erase Ps Character(s) (default = 1) (ECH).
|
* Erase Ps Character(s) (default = 1) (ECH).
|
||||||
*/
|
*/
|
||||||
public eraseChars(params: IParams): void {
|
public eraseChars(params: IParams): void {
|
||||||
this._terminal.buffer.lines.get(this._terminal.buffer.y + this._terminal.buffer.ybase).replaceCells(
|
this._restrictCursor();
|
||||||
this._terminal.buffer.x,
|
const line = this._terminal.buffer.lines.get(this._terminal.buffer.y + this._terminal.buffer.ybase);
|
||||||
this._terminal.buffer.x + (params.params[0] || 1),
|
if (line) {
|
||||||
this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())
|
line.replaceCells(
|
||||||
);
|
this._terminal.buffer.x,
|
||||||
this._terminal.updateRange(this._terminal.buffer.y);
|
this._terminal.buffer.x + (params.params[0] || 1),
|
||||||
|
this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())
|
||||||
|
);
|
||||||
|
this._terminal.updateRange(this._terminal.buffer.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user