Skip to content
Merged
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
12 changes: 12 additions & 0 deletions packages/coding-agent/src/modes/interactive/interactive-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2378,6 +2378,9 @@ export class InteractiveMode {
}
if (text === "/quit") {
this.editor.setText("");
if (this.session.isStreaming) {
return;
}
await this.shutdown();
return;
}
Expand Down Expand Up @@ -3038,6 +3041,9 @@ export class InteractiveMode {
// =========================================================================

private handleCtrlC(): void {
if (this.session.isStreaming) {
return;
}
const now = Date.now();
if (now - this.lastSigintTime < 500) {
void this.shutdown();
Expand All @@ -3049,6 +3055,9 @@ export class InteractiveMode {

private handleCtrlD(): void {
// Only called when editor is empty (enforced by CustomEditor)
if (this.session.isStreaming) {
return;
}
void this.shutdown();
}

Expand Down Expand Up @@ -3157,6 +3166,9 @@ export class InteractiveMode {

for (const signal of signals) {
const handler = () => {
if (this.session.isStreaming) {
return;
}
// SIGHUP no longer hard-exits: graceful shutdown emits session_shutdown
// first, then attempts terminal restore. A genuinely dead terminal
// surfaces as an EIO on the restore writes, which the stdout/stderr
Expand Down
Loading