summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 04:15:16 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit4b64d4b237b2bc5f8197e2232c84c0d1ed1a8fdb (patch)
tree725cd69dd0ae6990eafd71ec25bb0e52b9f354e8 /src/pardes.zig
parent7c59482436656443b698e867c423b27dd365a96c (diff)
downloadpardes-4b64d4b237b2bc5f8197e2232c84c0d1ed1a8fdb.tar.gz
pardes-4b64d4b237b2bc5f8197e2232c84c0d1ed1a8fdb.zip
A multi-line paste into Python's REPL runs whole, back at its prompt
The Enter went on Python's first output after the paste, before it had taken in the whole paste, and one Enter leaves a multi-line input at ... anyway. Python's output now only restarts a 100 ms quiet wait (the 250 ms fallback stays), and a paste of more than one line gets the second Enter a block gets. fs.py runs print(11)\nprint(22), the same with a trailing newline, and a for block followed by a statement in a real python3, each back at >>>. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index d6859f86..289dcee0 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -1652,7 +1652,21 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe
try std.testing.expectEqualStrings("\x1b[200~print(1)\x1b[201~", Sent.said(1));
p.update(.{ .output = .{ .pane = 1, .bytes = "print(1)" } });
Sent.drain(p);
+ // Python's echo only restarts a short wait: the Enter goes once the
+ // echo of the whole paste has gone quiet.
+ try std.testing.expectEqualStrings("", Sent.said(1));
+ p.now_ns = p.panes[1].?.repl_enter_due_ns;
+ p.update(.tick);
+ Sent.drain(p);
try std.testing.expectEqualStrings("\r", Sent.said(1));
+ // A paste of more than one line gets the blank line a block gets.
+ _ = exec.executeFrom(p, 0, "print(11)\nprint(22)", true);
+ Sent.drain(p);
+ try std.testing.expectEqualStrings("\x1b[200~print(11)\nprint(22)\x1b[201~", Sent.said(1));
+ p.now_ns = p.panes[1].?.repl_enter_due_ns;
+ p.update(.tick);
+ Sent.drain(p);
+ try std.testing.expectEqualStrings("\r\r", Sent.said(1));
// Nothing answering, it goes when its wait is up.
_ = exec.executeFrom(p, 0, "print(2)", true);
p.update(.tick); // on the clock: not yet, however old core time is