# Use ShellKind::try_quote whenever we need to quote shell args \(\#40912\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8f4646d6c357409cfc286104088b4d21f2bea851

Requested commit: 8f4646d6c357409cfc286104088b4d21f2bea851

Commit: 8f4646d6c357409cfc286104088b4d21f2bea851

Tree: 0671c9b24c9be7fae8adaa922e504967adb1035a

Author: Jakub Konka

Committer: GitHub

## Message

```
Use ShellKind::try_quote whenever we need to quote shell args (#40912)

Using `shlex` unconditionally is dangerous as it assumes the underlying
shell is POSIX which is not the case for PowerShell, CMD, or Nushell.
Therefore, whenever we want to quote the args we should utilise our
helper `util::shell::ShellKind::try_quote` which takes into account
which shell is being used to actually exec/spawn the invocation.

Release Notes:

- N/A

---------

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
```

## Parents

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

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