summaryrefslogtreecommitdiff
path: root/src/tagline.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/tagline.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/tagline.zig')
-rw-r--r--src/tagline.zig15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/tagline.zig b/src/tagline.zig
index 8c1efa7b..14bf5677 100644
--- a/src/tagline.zig
+++ b/src/tagline.zig
@@ -7,6 +7,7 @@ const modal = @import("modal.zig");
const ctlfs = @import("ninep/tree.zig");
const panes = @import("panes.zig");
const edit = @import("edit.zig");
+const exec = @import("exec.zig");
const config = @import("config.zig");
const pdf_enabled = panes.Pdf.enabled;
const dump = @import("dump.zig");
@@ -114,9 +115,17 @@ pub fn pathPrefix(arena: std.mem.Allocator, pane: *Pane) ![]const u8 {
if (pane.command) |line| {
const shown = line[0..@min(line.len, 48)];
const more = if (shown.len < line.len) "..." else "";
- if (!pane.command_done) return std.fmt.allocPrint(arena, "{s} ({s}{s}) running", .{ pane.cwdSlice(), shown, more });
- if (pane.command_status) |n| return std.fmt.allocPrint(arena, "{s} ({s}{s}) exit {d}", .{ pane.cwdSlice(), shown, more, n });
- return std.fmt.allocPrint(arena, "{s} ({s}{s}) exit ?", .{ pane.cwdSlice(), shown, more });
+ var idbuf: [48]u8 = undefined;
+ const id = exec.replId(&idbuf, pane);
+ const gap = if (id.len > 0) " " else "";
+ if (!pane.command_done) return std.fmt.allocPrint(arena, "{s} ({s}{s}) running{s}{s}", .{ pane.cwdSlice(), shown, more, gap, id });
+ if (pane.command_status) |n| return std.fmt.allocPrint(arena, "{s} ({s}{s}) exit {d}{s}{s}", .{ pane.cwdSlice(), shown, more, n, gap, id });
+ return std.fmt.allocPrint(arena, "{s} ({s}{s}) exit ?{s}{s}", .{ pane.cwdSlice(), shown, more, gap, id });
+ }
+ // A bound REPL says what it is bound as, beside its Tty word.
+ if (pane.repl != null) {
+ var idbuf: [48]u8 = undefined;
+ return std.fmt.allocPrint(arena, "{s} {s}", .{ pane.cwdSlice(), exec.replId(&idbuf, pane) });
}
if (pane.file) |f| {
const name = if (pane.prompt == .name) pane.input.own orelse f.path else f.path;