Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ boundary, the steer stays in a waiting row next to the editor instead of being
shown as committed conversation history. Once the runtime confirms injection,
the message moves into the transcript at its actual position and uses the normal
user-message `›` prefix. The `↪` marker is reserved for the temporary waiting
row.
row. `Ctrl+C` clears a non-empty editor draft first, including during an active
turn. With an empty editor it cancels the active turn, or exits when idle.

To keep a follow-up editable instead, press `Tab` while the editor contains
text and completion is closed. The input remains in the local next-turn queue.
Expand Down
6 changes: 3 additions & 3 deletions packages/zcode-tui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1408,12 +1408,12 @@ class ZCodeTui {
return { consume: true };
}
if (matchesKey(data, "ctrl+c")) {
if (this.turnAbortController) {
if (this.editor.getText()) {
this.editor.setText("");
} else if (this.turnAbortController) {
this.pendingSteerInterrupt = undefined;
this.turnAbortController.abort();
this.updateActivity("cancelling…");
} else if (this.editor.getText()) {
this.editor.setText("");
} else {
this.stop();
}
Expand Down
8 changes: 8 additions & 0 deletions scripts/smoke-tui-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ try {
featureTurnStart,
4_000
);
await sendAndWait(
"Discard this active-turn draft.",
"active-turn draft",
/Discard this active-turn draft\./i
);
terminal.write("\x03");
await Bun.sleep(renderSettleMilliseconds);
if (child.exitCode !== null) throw new Error("Ctrl+C exited ZCode instead of clearing the active-turn draft.");
await sendAndWait(
"Keep the final response concise.\r",
"pending active-turn steer",
Expand Down