fix(coding-agent): align python prompt mode detection

This commit is contained in:
can1357
2026-07-08 14:55:53 +02:00
parent b1bfaa7b55
commit 41f2074ec4
2 changed files with 18 additions and 1 deletions
@@ -251,6 +251,23 @@ describe("InputController keybinding setup", () => {
expect(spies.resetDisplay).toHaveBeenCalledTimes(1);
});
it("does not mark pasted shell prompts as Python mode while editing", async () => {
const { InputController, ctx, editor } = await createContext();
const controller = new InputController(ctx);
controller.setupKeyHandlers();
editor.onChange?.("$ cd ~/project && sudo ./build-and-push.sh o5.7 2>&1 | tail -4");
expect(ctx.isPythonMode).toBe(false);
expect(ctx.updateEditorBorderColor).not.toHaveBeenCalled();
editor.onChange?.("$ print(1)");
expect(ctx.isPythonMode).toBe(true);
expect(ctx.updateEditorBorderColor).toHaveBeenCalledTimes(1);
});
it("registers retry as an editor action and retries the failed turn", async () => {
const { InputController, ctx, editor, spies } = await createContext();
const controller = new InputController(ctx);