如何在 Rstudio 中将 windows 子系统用于 linux 和 z shell,而不是 bash?

How to use windows subsystem for linux with z shell, instead of bash, in Rstudio?

我默认使用 wsl 和 zsh shell。但是,在 windows Rstudio 中,我只能在终端设置中访问 PowerShell、CMD 和 bash。如何将 zsh 添加到这些选项?我知道可以在 Mac 和 Linux Rstudio 中使用自定义 shells 作为终端,但我想在 windows rstudio 中使用相同的功能。

您可以为您的 WSL 环境定义任何首选默认值 shell 看看这里的有效方法 - https://medium.com/@vinhp/set-and-use-zsh-as-default-shell-in-wsl-on-windows-10-the-right-way-4f30ed9592dc and after that, if you have WSL (properly) installed, you should be able to select Bash (WSL) 作为您的默认终端。

在完成一些测试后,即在我的 WSL2 的 zsh 上尝试各种变通方法后,我得出的结论是:https://support.rstudio.com/hc/en-us/articles/115010737148-Using-the-RStudio-Terminal?version=1.2.5033&mode=desktop#lifetime [x] 通过可执行路径的自定义 shell ==> 不适用于 Windows IDE(写在附录 A 的开头) 据此判断 - 在 WIN RStudio Desktop 1.2.5033 上 - 恕我直言,您只能通过发出 zsh 作为 WSL bash 终端中的第一个命令来启动它。