fix(app): refit terminal when returning to agent

This commit is contained in:
Mohamed Boudra
2026-02-17 23:03:11 +07:00
parent a5842482b0
commit 8c0d289c2a
4 changed files with 58 additions and 0 deletions
@@ -157,4 +157,18 @@ describe("terminal-emulator-runtime", () => {
expect(onCommittedA).toHaveBeenCalledTimes(1);
expect(onCommittedB).toHaveBeenCalledTimes(1);
});
it("forces a refit when resize is requested", () => {
const runtime = new TerminalEmulatorRuntime();
const fitAndEmitResize = vi.fn();
(runtime as unknown as { fitAndEmitResize: (force: boolean) => void }).fitAndEmitResize =
fitAndEmitResize;
runtime.resize();
runtime.resize({ force: true });
expect(fitAndEmitResize).toHaveBeenNthCalledWith(1, false);
expect(fitAndEmitResize).toHaveBeenNthCalledWith(2, true);
});
});