# debugger: Fix issues with restarting sessions \(\#33932\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e0c860c42a3669f7daabb7d902c6ad76a19d3da9

Requested commit: e0c860c42a3669f7daabb7d902c6ad76a19d3da9

Commit: e0c860c42a3669f7daabb7d902c6ad76a19d3da9

Tree: 511aa0ab77627565736631134f1f9972767ca39a

Author: Cole Miller

Committer: GitHub

## Message

```
debugger: Fix issues with restarting sessions (#33932)

Restarting sessions was broken in #33273 when we moved away from calling
`kill` in the shutdown sequence. This PR re-adds that `kill` call so
that old debug adapter processes will be cleaned up when sessions are
restarted within Zed. This doesn't re-introduce the issue that motivated
the original changes to the shutdown sequence, because we still send
Disconnect/Terminate to debug adapters when quitting Zed without killing
the process directly.

We also now remove manually-restarted sessions eagerly from the session
list.

Closes #33916 

Release Notes:

- debugger: Fixed not being able to restart sessions for Debugpy and
other adapters that communicate over TCP.
- debugger: Fixed debug adapter processes not being cleaned up.

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
```

## Parents

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

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