summaryrefslogtreecommitdiff
path: root/src/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 14:31:42 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commiteeadda6e7db3334e15708de2d7b5396f539c8186 (patch)
tree0852baa53df5df01dcb41b48f787044fae78fdf6 /src/panes.zig
parent8d93016e923565e2e8b73aa7b549dd65b5d18a8c (diff)
downloadpardes-eeadda6e7db3334e15708de2d7b5396f539c8186.tar.gz
pardes-eeadda6e7db3334e15708de2d7b5396f539c8186.zip
A terminal bound as a language's REPL takes the execs made on that language's files
Repl python in a terminal's tag or on its ctl binds it (Repl - unbinds, Repl bare says the binding, the same word again changes nothing), with an id, python-a, python-b, in its tag. An exec made by a gesture on the body of a file in that language -- a middle click or the execute key, on any text, a single word too -- or on the REPL's own body is typed into it, bracketed if its program asked for that, else line by line with a once-said warning for Python's blank lines, then Enter; the message row says -> python-a in the tag's name tint, the log send <from> <to> <id>. Several bound for the language: the pane asks which on its notice band, as Del asks, one key answering, Esc none, nothing remembered. The gesture is known where it is dispatched (mouse.zig, the execute key), so the tag's words, Exec <text> run by name and a command word @`cmd` stay commands, and a 9P exec is never sent. A finished command pane is no REPL; bindings are not dumped. The docs spell out the escapes, the pdb and input() caveat and the no-bracketed-paste papercut. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/panes.zig')
-rw-r--r--src/panes.zig17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/panes.zig b/src/panes.zig
index 2f8b6b56..9234912f 100644
--- a/src/panes.zig
+++ b/src/panes.zig
@@ -72,6 +72,10 @@ pub const Pane = struct {
/// Del from the keyboard with open panes both above and below: which
/// one takes the rows. Nothing is typed; one key answers.
del_side,
+ /// An exec from a file's body with several REPLs bound for its
+ /// language: which one takes it (exec.zig routeToRepl). One key
+ /// answers, the question being in `question`.
+ repl_choice,
/// A new name for the file, drafted in place of the path on the
/// tagline after a click there; Enter commits it, as a buffer name
/// and never a disk rename.
@@ -116,6 +120,18 @@ pub const Pane = struct {
/// (Pardes.acknowledgeShell); empty until the host says which it ran.
shell_tail: [96]u8 = undefined,
shell_tail_len: u8 = 0,
+ /// A terminal bound as a language's REPL (`Repl python`): an exec from
+ /// the body of a file in that language is sent to it (exec.zig
+ /// routeToRepl). `letter` makes its id, `python-a`, with the language's
+ /// name from grammar_manifest.
+ repl: ?struct { lang: u8, letter: u8 } = null,
+ /// It has been told that its program takes no bracketed paste.
+ repl_warned: bool = false,
+ /// A question with its answers in it (`repl_choice`).
+ question: [96]u8 = undefined,
+ question_len: u8 = 0,
+ /// The newest message says where an exec was sent: it is tinted.
+ msg_sent: bool = false,
/// The revision an Exit or a Restore last warned this pane was modified
/// at, and which of them: only that word goes ahead on the warning
/// (builtins.zig warnModified).
@@ -360,6 +376,7 @@ pub const Pane = struct {
return switch (p.prompt) {
.none, .name => null,
.del_side => config.del_question,
+ .repl_choice => p.question[0..p.question_len],
else => p.input.own orelse "",
};
}