### Bug description

Hello,

I am trying to run a bash code chunk using Quarto (`v1.2.269`).  The following works nicely
````
---
format:
  html:
    kernel: knitr
---
```{r}
```
```{bash}
echo "AA"
```
````

However, it uses the default git bash software, which does not support all bash/shell commands. I would like to use Ubuntu [Windows Subsystem for Linux (WSL)] installation instead [on windows 11 pro 22H2].

I was able to change the terminal in Rstudio [`v2022.07.2+576.`] as shown in the next screenshot. It works but only while using the terminal tab.
![image](https://user-images.githubusercontent.com/7375051/201476873-5780c2c7-78cf-4c8e-80fd-e5d85e2bddcd.png)

However, this does not apply to code chunks. I tried to change (force) Quarto to use a specific version of bash using the `engine.path` and `engine.opts` arguments without success [the same also occurred in VS code].
````
```{bash engine.path="C:/WINDOWS/system32/wsl.exe", engine.opts="-d Ubuntu-20.04"}
echo "Some text"
```
````
I receive the following error:
> running: C:/WINDOWS/system32/wsl.exe -d Ubuntu-20.04 -c "echo \"Some text\""
Quitting from lines 20-21 (211.qmd) 
>Error in engine(options) : I
> Calls: .main ... call_block -> block_exec -> in_input_dir -> in_dir -> engine
In addition: Warning message:
In system2(cmd, code, stdout = TRUE, stderr = TRUE, env = options$engine.env) :
> running command '"C:/WINDOWS/system32/wsl.exe" -d Ubuntu-20.04 -c "echo \"Some text\""' had status 65535
Execution halted

Note that running the following command in the command prompt `"C:/WINDOWS/system32/wsl.exe" -d Ubuntu-20.04 echo "Some text"` works with printing the 'some text' string. I am not an expert in this, but I think there may be a problem with additional quotations and the `-c` argument.

Could you please help me with using the wsl installation of Ubunto in Quarto?

> This may be related to this issue posted on [RStudio](https://github.com/rstudio/rstudio/issues/7493).

Thanks, Ahmed

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cderv
2022-11-12T14:02:56Z
elgabbas
bug needs-repro windows
closed
Running bash chunks using wsl
https://github.com/quarto-dev/quarto-cli/issues/3302