fix: suppress input text for kitty release events
Release events now produce empty input to prevent character duplication when reportEventTypes flag is enabled. key.eventType is still passed through so handlers can detect release events. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,11 @@ const KittyInput = defineComponent({
|
||||
return;
|
||||
}
|
||||
|
||||
if (props.test === "releaseEmpty" && input === "" && key.eventType === "release") {
|
||||
exit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (props.test === "queryResponse") {
|
||||
throw new Error("Query response should not reach handler");
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ it("useInput - handle kitty protocol repeat event", async () => {
|
||||
expect(ps.output).toContain("exited");
|
||||
});
|
||||
|
||||
it("useInput - handle kitty protocol release event", async () => {
|
||||
const ps = term("use-input-kitty", ["release"]);
|
||||
it("useInput - release event produces empty input", async () => {
|
||||
const ps = term("use-input-kitty", ["releaseEmpty"]);
|
||||
ps.write(kittyKey(97, 1, 3));
|
||||
await ps.waitForExit();
|
||||
expect(ps.output).toContain("exited");
|
||||
|
||||
Reference in New Issue
Block a user