How do I get Windows 10 Terminal to launch WSL?

前端 未结 7 1590
长发绾君心
长发绾君心 2021-01-30 09:31

I\'m using the new Windows Terminal, and trying to get it to launch my WSL terminal. This is the setting that I\'m trying to use:

        {
            \"acrylic         


        
相关标签:
7条回答
  • 2021-01-30 10:09

    The premise of the question was fouled by the mistake with the GUID, as the OP says the sample code was actually correct. So, the question could be re-interpreted as--

    What is the minimum required change to the default settings.json to point to an application of your choosing? (which is what got me here)

    1. guid - has to be unique. I've had success with changing just the last number for each customization.

    2. commandline - From within Bravo Yeung's answer is a link to a sample settings.json file: "commandline": "wsl ~"

    This little bitty value is made possible by setting a default distro: "The default WSL distribution is the one that runs when you run wsl on a command line:"

    wsl --setdefault <DistributionName>

    However, seems commandline:wsl doesn't work with startingDirectory. I've successfully omitted commandline in favor of source + startingDirectory:

    // Make changes here to the cmd.exe profile.
    "guid": "{long-guid-here}",
    "hidden": false,
    "name": "Debian",
    "tabTitle" : "WSL (Debian)",
    "source": "Windows.Terminal.Wsl",
    "startingDirectory" : "C:\\Users\\myuser"
    

    Here is a good link which got me started the first time I installed Windows Terminal and customized the settings, Easily add Anaconda Prompt to Windows Terminal to make life better

    0 讨论(0)
提交回复
热议问题