Intellij Windows 终端作为终端(在 IDE 中)

key*_*hha 4 windows intellij-idea windows-subsystem-for-linux

我在 Ubuntu 18.04 中使用 WSL。

在 Intellij 中,我想将终端更改为 Windows 终端(或 Ubuntu 终端),但是当我添加wt.exe为 shell 路径(文件 -> 设置 -> 工具 -> 终端)时,ide 返回带有 Windows 终端的新窗口(不在 ide 的底部) )。

我也使用了 Windows Terminal.exe 路径,但它不起作用。

C:\Users\USER\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminal_8wekyb3d8bbwe/wt.exe
Run Code Online (Sandbox Code Playgroud)

ran*_*anu 12

现在,您只需使用wsl.exeIntelliJ IDEA 终端设置中的字符串即可在 IDE 中使用 WSL 终端,如文档所述:

Shell 路径
指定默认运行的 shell。以下是不同 shell 的一些示例:

  • 重击:/bin/bash
  • Z shell:/bin/zsh
  • Windows 版 Bash:bash.exe
  • WSL:wsl.exe
  • PowerShell: 电源外壳
  • 命令提示符:cmd.exe
  • Cygwin: "C:\cygwin\bin\bash.exe" --login -i


Cra*_*der 10

您不能在 IntelliJ IDEA 中使用 GUI 应用程序作为终端外壳,请使用命令行应用程序,如cmd.exe,powershell.exec:\Windows\System32\bash.exe