-
Notifications
You must be signed in to change notification settings - Fork 2k
fix(extension): allow killing detached processes #5167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8b9de69
b0329ce
5297d28
b7054d1
303fbad
db123ab
53ada78
02f6583
4fe9485
3d23a26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "kilo-code": patch | ||
| --- | ||
|
|
||
| Fix: "Kill Command" button now reliably terminates processes on all platforms, including those running in the background. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,10 +257,10 @@ export class TerminalProcess extends BaseTerminalProcess { | |
| } | ||
|
|
||
| public override abort() { | ||
| if (this.isListening) { | ||
| // Send SIGINT using CTRL+C | ||
| this.terminal.terminal.sendText("\x03") | ||
| } | ||
| // User-initiated kill must always attempt to interrupt the process. | ||
| // Listening state does not reflect process liveness. | ||
| const terminal = this.terminalRef.deref() | ||
| terminal?.terminal?.sendText("\x03") | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change is needed What this fixes We now send Ctrl‑C unconditionally on user‑initiated abort. Listening state is about UI streaming, not process liveness. This makes “Kill” work even after “Proceed/Continue,” which matches user intent and doesn’t affect normal execution. |
||
|
|
||
| public override hasUnretrievedOutput(): boolean { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why keep task.terminalProcess when running in background
When the user clicks “Proceed/Continue,” we allow the command to keep running in the terminal. At that point the promise resolves and we enter finally, which used to clear task.terminalProcess.
That wiped the only handle the kill button uses, so later aborts did nothing even though the process was still alive.
By only clearing the reference when not running in background, we keep the handle around so the kill button can still terminate the process after “Proceed/Continue.”