fix(common): pass radix 10 when parsing OSC color indices

InputHandler parsed palette indices from OSC color sequences with
parseInt without a radix after validating digits-only slots. Use
base 10 for set/report and restore color index parsing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Daniel Imms
2026-06-01 15:05:43 +00:00
committed by Cursor Agent
co-authored by Cursor
parent 878e3fc52d
commit b0f6aed4a1
+2 -2
View File
@@ -3065,7 +3065,7 @@ export class InputHandler extends Disposable implements IInputHandler {
const idx = slots.shift() as string;
const spec = slots.shift() as string;
if (/^\d+$/.exec(idx)) {
const index = parseInt(idx);
const index = parseInt(idx, 10);
if (isValidColorIndex(index)) {
if (spec === '?') {
event.push({ type: ColorRequestType.REPORT, index });
@@ -3228,7 +3228,7 @@ export class InputHandler extends Disposable implements IInputHandler {
const slots = data.split(';');
for (let i = 0; i < slots.length; ++i) {
if (/^\d+$/.exec(slots[i])) {
const index = parseInt(slots[i]);
const index = parseInt(slots[i], 10);
if (isValidColorIndex(index)) {
event.push({ type: ColorRequestType.RESTORE, index });
}