fix(tui): preserve kitty event reporting mode
This commit is contained in:
@@ -1100,9 +1100,9 @@ export class ProcessTerminal implements Terminal {
|
||||
const reportedFlags = parseInt(match[1]!, 10);
|
||||
this.#kittyProtocolActive = true;
|
||||
setKittyProtocolActive(true);
|
||||
if (reportedFlags >= 3) {
|
||||
// Already enriched (Ghostty/foot may keep flags from a parent app).
|
||||
// Push level-2 to lock in event reporting.
|
||||
if ((reportedFlags & 2) !== 0) {
|
||||
// Preserve event-type reporting already enabled by a parent app.
|
||||
// Push level-2 to keep its shortcuts reporting consistently.
|
||||
this.#kittyEnableSeq = "\x1b[>7u";
|
||||
this.#safeWrite(this.#kittyEnableSeq);
|
||||
} else {
|
||||
|
||||
@@ -60,6 +60,28 @@ describe("ProcessTerminal kitty keyboard progressive-enhancement ordering", () =
|
||||
expect(out).not.toContain("\x1b[>4;2m");
|
||||
});
|
||||
|
||||
it("keeps alternate-key reporting without enabling event types after a previous session", async () => {
|
||||
harness = createProcessTerminalRenderHarness(100, 30);
|
||||
await harness.settle();
|
||||
harness.writes.length = 0;
|
||||
|
||||
await harness.feed("\x1b[?5u");
|
||||
|
||||
const out = harness.writes.join("");
|
||||
expect(out).toContain("\x1b[>5u");
|
||||
expect(out).not.toContain("\x1b[>7u");
|
||||
});
|
||||
|
||||
it("preserves event-type reporting enabled by a parent app", async () => {
|
||||
harness = createProcessTerminalRenderHarness(100, 30);
|
||||
await harness.settle();
|
||||
harness.writes.length = 0;
|
||||
|
||||
await harness.feed("\x1b[?3u");
|
||||
|
||||
expect(harness.writes.join("")).toContain("\x1b[>7u");
|
||||
});
|
||||
|
||||
it("enables kitty when the DA1 sentinel arrives before the kitty reply (#2042)", async () => {
|
||||
harness = createProcessTerminalRenderHarness(100, 30);
|
||||
await harness.settle();
|
||||
|
||||
Reference in New Issue
Block a user