首页 > 解决方案 > Setting default windows terminal starting directory to folder within c drive WSL

问题描述

I am trying to set my default terminal for my WSL prompt in windows terminal to start at a specific folder under the C drive.

i am able to set the default to /mnt but it wont let me go /mnt/c/<myfolder> whenever i do this is sets it back to /mnt/c/Users/<myuser>

标签: windows-subsystem-for-linuxwindows-terminal

解决方案


如果settings.json您正在使用该commandline属性,请将该行替换为:

"source": "Windows.Terminal.Wsl"

然后使用驱动器号和路径中的正斜杠将您的startingDirectory的值设置为C驱动器中您喜欢的任何位置,所以它看起来像这样:

"startingDirectory" : "C:/Windows/Fonts",


推荐阅读