From 754ffc99799c3a251634c1eff9a16eabbd73b31c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 22:14:32 -0300 Subject: A Python block sent to a REPL gets the second Enter that ends it A dogfood agent's `def` sent to python3 sat open at the continuation prompt: a block whose last line is indented is not over at one Enter, pasted into 3.13's REPL or typed into the old one (checked against python 3.14 in a real pty, both ways). A send to a Python REPL now adds that second Enter, and the pty/data recipe in the docs and the 9P skill says to. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 239987ea..e20eb17e 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1474,6 +1474,11 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe _ = exec.executeFrom(p, 0, "a = 1\r\nb = \x1b[201~2", true); Sent.drain(p); try std.testing.expectEqualStrings("a = 1\rb = [201~2\r", Sent.said(1)); + // A block left open by its indented last line gets the blank line that + // ends it: a second Enter. + _ = exec.executeFrom(p, 0, "def f():\n return 1", true); + Sent.drain(p); + try std.testing.expectEqualStrings("def f():\r return 1\r\r", Sent.said(1)); // Several selections executed at once: each is sent, not the first. { const text = try edit.flatSurface(p, &file.body); -- cgit v1.3