# debugger: Fix Debugpy attach with connect session startup \(\#41690\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ecbdffc84f1165323f256e8485ae84320550c759

Requested commit: ecbdffc84f1165323f256e8485ae84320550c759

Commit: ecbdffc84f1165323f256e8485ae84320550c759

Tree: 454e6494177bbcc6a25c3847612b8659ef10027a

Author: Anthony Eid

Committer: GitHub

## Message

```
debugger: Fix Debugpy attach with connect session startup  (#41690)

Closes #38345, #34882, #33280

Debugpy has four distinct configuration scenarios, which are:
1. launch
2. attach with process id
3. attach with listen
4. attach with connect

Spawning Debugpy directly works with the first three scenarios but not
with "attach with connect". Which requires host/port arguments being
passed in both with an attach request and when starting up Debugpy. This
PR passes in the right arguments when spawning Debugpy in an attach with
connect scenario, thus fixing the bug.

The VsCode extension comment that explains this:
https://github.com/microsoft/vscode-python-debugger/blob/98f5b93ee4259f99b679d7c45163ba7babcbff6d/src/extension/debugger/adapter/factory.ts#L43-L51

Release Notes:

- debugger: Fix Python attach-based sessions not working with `connect`
or `port` arguments
```

## Parents

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

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