summaryrefslogtreecommitdiff
path: root/src/Core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core.zig')
-rw-r--r--src/Core.zig21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/Core.zig b/src/Core.zig
index 700ab7ab..55848aa9 100644
--- a/src/Core.zig
+++ b/src/Core.zig
@@ -993,7 +993,16 @@ pub fn acknowledgeShell(p: *Pardes, id: usize, executable: []const u8, prompt_ma
} else |_| {}
}
};
- if (id < MAX_PANES) pardes.panes.terminal.shellSpawned(p, id, prompt_marks);
+ // The lines queued for it go when it can take them: at its first
+ // prompt, or now when it draws no marks to wait for.
+ if (id < MAX_PANES) if (p.panes[id]) |pane| if (pane.isTerminal() and pane.pending_command.wait == .spawn) {
+ if (prompt_marks) {
+ pane.pending_command.wait = .input;
+ } else {
+ pane.greet = false;
+ pane.releasePendingCommand(p, id, true);
+ }
+ };
if (p.settings.shell.effective.set(executable))
p.settings.shell.pending = false;
}
@@ -1874,15 +1883,19 @@ pub fn sync(p: *Pardes) void {
// A directory pane's entries follow its width, as acme's
// columns do (Dir.fit).
if (pane.file) |file| if (file.listing != null and r.h > pane.tag_rows) pardes.panes.Dir.fit(p, pane, pane.cols);
- pardes.panes.terminal.releasePendingCommandIfReady(p, id, pane);
+ if (pane.pending_command.wait == .input) pane.releasePendingCommand(p, id, tape.value(.prompt, struct {
+ fn ready(at: *const Pane) bool {
+ return pardes.Term.prompt(at.terminal).input_ready;
+ }
+ }.ready, .{pane}));
// Which bands a pane shows is the step's, as its geometry is:
// what is drawn under them, and where a click lands, read it.
Messages.collectNotices(p, pane, r, id);
// The greeting `ls` of a new terminal in a directory is typed at
// its shell's FIRST prompt, or never: typed later it would land
// in whatever runs then, or in the middle of a line someone
- // typed (panes.terminal.greeting).
- if (pane.greet and pane.isTerminal() and p.resize_count > 0) switch (tape.value(.prompt, pardes.panes.terminal.greeting, .{pane})) {
+ // typed (Pane.greeting).
+ if (pane.greet and pane.isTerminal() and p.resize_count > 0) switch (tape.value(.prompt, Pane.greeting, .{pane})) {
.wait => {},
.never => pane.greet = false,
.now => {