Skip to content

Commit 22a4dc4

Browse files
authored
Merge pull request #4478 from jerch/fix_4469
fix DECRQM reports
2 parents 0ff06db + ee26780 commit 22a4dc4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/common/InputHandler.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,7 @@ describe('InputHandler', () => {
22222222
});
22232223
it('ANSI 2 (keyboard action mode)', async () => {
22242224
await inputHandler.parseP('\x1b[2$p');
2225-
assert.deepEqual(reportStack.pop(), '\x1b[2;3$y'); // always set
2225+
assert.deepEqual(reportStack.pop(), '\x1b[2;4$y'); // always reset
22262226
});
22272227
it('ANSI 4 (insert mode)', async () => {
22282228
await inputHandler.parseP('\x1b[4$p');
@@ -2236,7 +2236,7 @@ describe('InputHandler', () => {
22362236
});
22372237
it('ANSI 12 (send/receive)', async () => {
22382238
await inputHandler.parseP('\x1b[12$p');
2239-
assert.deepEqual(reportStack.pop(), '\x1b[12;4$y'); // always reset
2239+
assert.deepEqual(reportStack.pop(), '\x1b[12;3$y'); // always set
22402240
});
22412241
it('ANSI 20 (newline mode)', async () => {
22422242
await inputHandler.parseP('\x1b[20$p');
@@ -2280,7 +2280,7 @@ describe('InputHandler', () => {
22802280
});
22812281
it('DEC privates perma modes', async () => {
22822282
// [mode number, state value]
2283-
const perma = [[3, 0], [8, 3], [1005, 4], [1015, 4], [1048, 1]];
2283+
const perma = [[3, 0], [8, 3], [67, 4], [1005, 4], [1015, 4], [1048, 1]];
22842284
for (const [mode, value] of perma) {
22852285
await inputHandler.parseP(`\x1b[?${mode}$p`);
22862286
assert.deepEqual(reportStack.pop(), `\x1b[?${mode};${value}$y`);

src/common/InputHandler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,9 +2223,9 @@ export class InputHandler extends Disposable implements IInputHandler {
22232223
const p = params.params[0];
22242224

22252225
if (ansi) {
2226-
if (p === 2) return f(p, V.PERMANENTLY_SET);
2226+
if (p === 2) return f(p, V.PERMANENTLY_RESET);
22272227
if (p === 4) return f(p, b2v(cs.modes.insertMode));
2228-
if (p === 12) return f(p, V.PERMANENTLY_RESET);
2228+
if (p === 12) return f(p, V.PERMANENTLY_SET);
22292229
if (p === 20) return f(p, b2v(opts.convertEol));
22302230
return f(p, V.NOT_RECOGNIZED);
22312231
}
@@ -2240,6 +2240,7 @@ export class InputHandler extends Disposable implements IInputHandler {
22402240
if (p === 25) return f(p, b2v(!cs.isCursorHidden));
22412241
if (p === 45) return f(p, b2v(dm.reverseWraparound));
22422242
if (p === 66) return f(p, b2v(dm.applicationKeypad));
2243+
if (p === 67) return f(p, V.PERMANENTLY_RESET);
22432244
if (p === 1000) return f(p, b2v(mouseProtocol === 'VT200'));
22442245
if (p === 1002) return f(p, b2v(mouseProtocol === 'DRAG'));
22452246
if (p === 1003) return f(p, b2v(mouseProtocol === 'ANY'));

0 commit comments

Comments
 (0)