# acp: Ensure connection subprocess gets killed on drop \(\#37858\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/d7a9be03d193b744a1d16e089f78e2be3d6d8f73)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: d7a9be03d193b744a1d16e089f78e2be3d6d8f73

Requested commit: d7a9be03d193b744a1d16e089f78e2be3d6d8f73

Commit: d7a9be03d193b744a1d16e089f78e2be3d6d8f73

Tree: d16fc696cdbc51b61892fd1acb3c558a83f6285b

Author: Agus Zubiaga

Committer: GitHub

## Message

```
acp: Ensure connection subprocess gets killed on drop (#37858)

It appears that in macOS, the `AcpConnection._wait_task` doesn't always
get dropped when quitting the app. In these cases, the subprocess would
be kept alive because we move the `child` into it.

Instead, we will now explicitly kill it when `AcpConnection` is dropped.
It's ok to do this because when the connection is dropped, the thread is
also dropped, so there's no need to report the exit status to it.

Closes #37741

Release Notes:

- Claude Code: Fix subprocess leak on app quit
```

## Parents

- [cdbddc21708419287c4d249b34199b9fef0a280d](https://git.cafe/gitcafe/zed/commit/cdbddc21708419287c4d249b34199b9fef0a280d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/d7a9be03d193b744a1d16e089f78e2be3d6d8f73?format=markdown)
