Skip to content

Commit

Permalink
Merge pull request #4478 from jerch/fix_4469
Browse files Browse the repository at this point in the history
fix DECRQM reports
  • Loading branch information
Tyriar authored May 24, 2023
2 parents 0ff06db + ee26780 commit 22a4dc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/common/InputHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@ describe('InputHandler', () => {
});
it('ANSI 2 (keyboard action mode)', async () => {
await inputHandler.parseP('\x1b[2$p');
assert.deepEqual(reportStack.pop(), '\x1b[2;3$y'); // always set
assert.deepEqual(reportStack.pop(), '\x1b[2;4$y'); // always reset
});
it('ANSI 4 (insert mode)', async () => {
await inputHandler.parseP('\x1b[4$p');
Expand All @@ -2236,7 +2236,7 @@ describe('InputHandler', () => {
});
it('ANSI 12 (send/receive)', async () => {
await inputHandler.parseP('\x1b[12$p');
assert.deepEqual(reportStack.pop(), '\x1b[12;4$y'); // always reset
assert.deepEqual(reportStack.pop(), '\x1b[12;3$y'); // always set
});
it('ANSI 20 (newline mode)', async () => {
await inputHandler.parseP('\x1b[20$p');
Expand Down Expand Up @@ -2280,7 +2280,7 @@ describe('InputHandler', () => {
});
it('DEC privates perma modes', async () => {
// [mode number, state value]
const perma = [[3, 0], [8, 3], [1005, 4], [1015, 4], [1048, 1]];
const perma = [[3, 0], [8, 3], [67, 4], [1005, 4], [1015, 4], [1048, 1]];
for (const [mode, value] of perma) {
await inputHandler.parseP(`\x1b[?${mode}$p`);
assert.deepEqual(reportStack.pop(), `\x1b[?${mode};${value}$y`);
Expand Down
5 changes: 3 additions & 2 deletions src/common/InputHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2223,9 +2223,9 @@ export class InputHandler extends Disposable implements IInputHandler {
const p = params.params[0];

if (ansi) {
if (p === 2) return f(p, V.PERMANENTLY_SET);
if (p === 2) return f(p, V.PERMANENTLY_RESET);
if (p === 4) return f(p, b2v(cs.modes.insertMode));
if (p === 12) return f(p, V.PERMANENTLY_RESET);
if (p === 12) return f(p, V.PERMANENTLY_SET);
if (p === 20) return f(p, b2v(opts.convertEol));
return f(p, V.NOT_RECOGNIZED);
}
Expand All @@ -2240,6 +2240,7 @@ export class InputHandler extends Disposable implements IInputHandler {
if (p === 25) return f(p, b2v(!cs.isCursorHidden));
if (p === 45) return f(p, b2v(dm.reverseWraparound));
if (p === 66) return f(p, b2v(dm.applicationKeypad));
if (p === 67) return f(p, V.PERMANENTLY_RESET);
if (p === 1000) return f(p, b2v(mouseProtocol === 'VT200'));
if (p === 1002) return f(p, b2v(mouseProtocol === 'DRAG'));
if (p === 1003) return f(p, b2v(mouseProtocol === 'ANY'));
Expand Down

0 comments on commit 22a4dc4

Please sign in to comment.