# Fix external agent authentication with spaces in paths \(\#38175\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e9b4f59e0f2b732424d830b3c49119fd3c233b59

Requested commit: e9b4f59e0f2b732424d830b3c49119fd3c233b59

Commit: e9b4f59e0f2b732424d830b3c49119fd3c233b59

Tree: 82c5b348eefeb701d8a9461876d1f1c36722c4d0

Author: Hakan Ensari

Committer: GitHub

## Message

```
Fix external agent authentication with spaces in paths (#38175)

This fixes terminal-based authentication for external ACP agents (Claude
Code, Gemini CLI) when file paths contain spaces, like "Application
Support" on macOS and "Program Files" on Windows.

When users click authentication buttons or type `/login`, they get
errors like `Cannot find module '/Users/username/Library/Application'`
because the path gets split at the space.

The fix removes redundant `shlex::try_quote` calls from
`spawn_external_agent_login`. These were causing double-quoting since
the terminal spawning code already handles proper shell escaping.

Added a test to verify paths with spaces aren't pre-quoted.

Release Notes:

- Fixed external agent authentication failures when file paths contain
spaces

---------

Co-authored-by: Hakan Ensari <hakanensari@users.noreply.github.com>
Co-authored-by: Claude <claude@anthropic.com>
```

## Parents

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

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