diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 14:20:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | e7c181d6238dae4b08a02c1a9828917c2497f89d (patch) | |
| tree | 299d4146c53ca5f882ba37cceb67a37302be2437 /src/tagline.zig | |
| parent | eb2428115588004a8bc04a09d45fb1104f727882 (diff) | |
| download | pardes-e7c181d6238dae4b08a02c1a9828917c2497f89d.tar.gz pardes-e7c181d6238dae4b08a02c1a9828917c2497f89d.zip | |
A command line runs as its own command pane unless it is clicked at a shell's prompt
A middle click, an exec write or a tag word that no builtin knows was typed
into some terminal for the pane's directory, sharing whatever state that
shell was in and answering nothing, so a misspelling vanished into a shell.
Now only a line clicked at an interactive terminal's prompt is typed there.
From anywhere else it runs as a command pane: a terminal whose child is
$SHELL -c the line in the pane's directory, full emulation, which shows its
output and then exit N from the host's reaping of the child, and stays. A
finished command pane is the next command's for its directory, which runs
below what it showed after a '% line' line (acme appends to +Errors and never
clears it, util.c:213); a running one gets a second pane. Kill ends a command
pane's whole process group, the log records run and exit, exec reads back the
command pane's serial, and a line is at most 1 KB, read off the pane as the
host forks rather than carried in every spawn effect. ttyForDir's search for
a free shell is gone. The goldens of chordcut, cmdword and layout-open change
where a file's exec now opens a command pane, and ttytaken is rewritten to
exec from the terminal itself; docs/open-questions.md records the decision.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/tagline.zig')
| -rw-r--r-- | src/tagline.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tagline.zig b/src/tagline.zig index 92c18510..8b214fa6 100644 --- a/src/tagline.zig +++ b/src/tagline.zig @@ -21,6 +21,7 @@ pub const file_pane_tail = " " ++ config.file_pane_builtins_str; pub const context_pane_tail = file_pane_tail ++ " TreeContext"; pub const locations_pane_tail = file_pane_tail ++ " LocationsConfig"; pub const terminal_pane_tail = " " ++ config.terminal_pane_builtins_str; +pub const command_pane_tail = " " ++ config.command_pane_builtins_str; const dirty_marker = " *"; pub const legacy_pane_tail = " Del"; pub const legacy_file_pane_tail = " Save Del"; @@ -109,6 +110,14 @@ pub fn pathPrefix(arena: std.mem.Allocator, pane: *Pane) ![]const u8 { if (comptime pdf_enabled) if (pane.pdf) |pv| return std.fmt.allocPrint(arena, "{s} [{d}/{d}]", .{ pv.path, pv.page + 1, pv.page_count }); if (pane.image) |*state| return panes.Image.tagPrefix(arena, state); + // A command pane: its directory, the line it runs, and how that went. + 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 }); + } if (pane.file) |f| { const name = if (pane.prompt == .name) pane.input.own orelse f.path else f.path; if (panes.Output.fileTraits(f.output).saves and f.revision != f.saved_revision) @@ -148,6 +157,7 @@ pub fn defaultTail(pane: *const Pane) []const u8 { if (panes.Output.usesLocationsConfig(out.from)) return locations_pane_tail; if (panes.File.supportsContext(pane)) return context_pane_tail; if (pane.file != null) return file_pane_tail; + if (pane.command != null) return command_pane_tail; if (pane.isTerminal()) return terminal_pane_tail; return pane_tail; } |
