在 Windows 终端中运行该命令ubuntu会将目录设置为 linux 默认目录,但运行wsl会导致其挂载在/mnt/%USERPROFILE%. 我知道我可以直接运行ubuntu,但我习惯了使用wsl。我检查了我的 Windows 终端配置,结果很好(没有定义目录,使用下拉菜单设置为~)。如果这听起来令人困惑,我很抱歉,因为我对 wsl 还比较陌生。直到最近,终端才出现这样的行为。设置StartingDirectory或CommandLine不起作用。这个问题可能更多地与 WSL 有关,而不是与 Ubuntu 有关
wsl打开 Ubuntu WSL~
打开 Ubuntu WSL/mnt/c/users/<username>
command-line ubuntu windows-subsystem-for-linux windows-terminal wsl2