Save cursor and restore more modes

Fixes #1526
This commit is contained in:
Daniel Imms
2025-12-30 04:49:54 -08:00
parent a5af434e3e
commit 857c4529cd
8 changed files with 59 additions and 5 deletions
+22
View File
@@ -199,6 +199,28 @@ describe('InputHandler', () => {
assert.equal(bufferService.buffer.y, 2);
assert.equal(inputHandler.curAttrData.fg, 3);
});
describe('DECSC/DECRC - save and restore cursor', () => {
it('should save and restore origin mode', async () => {
assert.equal(coreService.decPrivateModes.origin, false);
await inputHandler.parseP('\x1b[?6h');
assert.equal(coreService.decPrivateModes.origin, true);
await inputHandler.parseP('\x1b7');
await inputHandler.parseP('\x1b[?6l');
assert.equal(coreService.decPrivateModes.origin, false);
await inputHandler.parseP('\x1b8');
assert.equal(coreService.decPrivateModes.origin, true);
});
it('should save and restore wraparound mode', async () => {
assert.equal(coreService.decPrivateModes.wraparound, true);
await inputHandler.parseP('\x1b[?7l');
assert.equal(coreService.decPrivateModes.wraparound, false);
await inputHandler.parseP('\x1b7');
await inputHandler.parseP('\x1b[?7h');
assert.equal(coreService.decPrivateModes.wraparound, true);
await inputHandler.parseP('\x1b8');
assert.equal(coreService.decPrivateModes.wraparound, false);
});
});
describe('setCursorStyle', () => {
it('should call Terminal.setOption with correct params', () => {
inputHandler.setCursorStyle(Params.fromArray([0]));