diff --git a/src/agents/pty-keys.test.ts b/src/agents/pty-keys.test.ts index 87c001cf2..b0a9350c4 100644 --- a/src/agents/pty-keys.test.ts +++ b/src/agents/pty-keys.test.ts @@ -14,6 +14,9 @@ test("encodeKeySequence maps common keys and modifiers", () => { const shiftTab = encodeKeySequence({ keys: ["S-Tab"] }); expect(shiftTab.data).toBe("\x1b[Z"); + + const kpEnter = encodeKeySequence({ keys: ["KPEnter"] }); + expect(kpEnter.data).toBe("\x1bOM"); }); test("encodeKeySequence supports hex + literal with warnings", () => { diff --git a/src/agents/pty-keys.ts b/src/agents/pty-keys.ts index cf54d4c92..a3bc9561e 100644 --- a/src/agents/pty-keys.ts +++ b/src/agents/pty-keys.ts @@ -51,6 +51,22 @@ const namedKeyMap = new Map([ ["f10", `${ESC}[21~`], ["f11", `${ESC}[23~`], ["f12", `${ESC}[24~`], + ["kp/", `${ESC}Oo`], + ["kp*", `${ESC}Oj`], + ["kp-", `${ESC}Om`], + ["kp+", `${ESC}Ok`], + ["kp7", `${ESC}Ow`], + ["kp8", `${ESC}Ox`], + ["kp9", `${ESC}Oy`], + ["kp4", `${ESC}Ot`], + ["kp5", `${ESC}Ou`], + ["kp6", `${ESC}Ov`], + ["kp1", `${ESC}Oq`], + ["kp2", `${ESC}Or`], + ["kp3", `${ESC}Os`], + ["kp0", `${ESC}Op`], + ["kp.", `${ESC}On`], + ["kpenter", `${ESC}OM`], ]); const modifiableNamedKeys = new Set([