# terminal: Fix escaping arguments when using CMD as the shell \(\#39701\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 4684d6b50ecb67cde724edce58b493a8497bd037

Requested commit: 4684d6b50ecb67cde724edce58b493a8497bd037

Commit: 4684d6b50ecb67cde724edce58b493a8497bd037

Tree: a319b8289919b68aefee4225147a29961b262cd5

Author: Jakub Konka

Committer: GitHub

## Message

```
terminal: Fix escaping arguments when using CMD as the shell (#39701)

A couple of caveats:
- We should not auto-escape arguments with Alacritty's `escape_args`
option if using CMD otherwise, the generated command will have way too
many escaped characters for CMD to parse correctly.
- When composing a full command for CMD, we need to put it in double
quotes manually: `cmd /C "activate.bat& pwsh.exe -C do_something"` so
that CMD executes the entire string as a sequence of commands.
- CMD requires `&` as a chaining operator for commands (`;` for other
shells).

Release Notes:

- N/A
```

## Parents

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

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