Terminal: Feature Request

Created on 5 Jul 2019  路  6Comments  路  Source: microsoft/terminal

I'm pretty new to using linux, and don't understand much, but my issue is the following:
Every time I use the linux subsystem in windows 10, I want to work in the same directory, where my repos are located. I want to switch to the new terminal app, but every time I open a new linux terminal, it starts out in my windows system 32 directory, whereas I would like it to start where my repositories are located. Using the terminal that's provided with the ubuntu for windows app, I simply made a new shortcut, that starts in my desired location. Any way to do this with the new app?
tldr: start new linux terminal at a specific directory instead of /mnt/c/WINDOWS/system32
sorry if this is the wrong place to ask this.


The json offers the option to specify a starting directory for both powershell and cmd. If possible, it would be awesome to have that same option for a new bash instance.

Area-Settings Issue-Question Product-Terminal Resolution-Answered

Most helpful comment

This is because startingDirectory refers to a Windows path.

All 6 comments

The startingDirectory setting works for WSL sessions too. Just add it to the profile you want in the "profiles.json" file. startingDirectory also takes environment variables, so feel free to add that in as one (or create an environment variable for where your repos are located).

The startingDirectory setting works for WSL sessions too. Just add it to the profile you want in the "profiles.json" file. startingDirectory also takes environment variables, so feel free to add that in as one (or create an environment variable for where your repos are located).

thanks, just didn't think of simply adding it to the json馃槃. this helped me a lot...

   {
            "acrylicOpacity" : 0.5,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d Ubuntu",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Consolas",
            "fontSize" : 10,
            "guid" : "{2c4de342-38b7-51cf-b940-2309a097f518}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
            "name" : "Ubuntu",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "startingDirectory" : "/mnt/c/TEMP",
            "useAcrylic" : false
        },

What is missing in this profile, because it is not starting in the startingDirectory?
(and, YES, the directory '/mnt/c/TEMP' does exist)

Took me a bit but finally figured it out. Try "startingDirectory" : "/TEMP".

This is because startingDirectory refers to a Windows path.

this is what it looks like for me, now that I've added startingDirectory to the bash settings:
"startingDirectory" : "%USERPROFILE%/Projekte/Programming/Python/GithubRepos",
because at first, it was missing startingDirectory.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

migueldeicaza picture migueldeicaza  路  58Comments

NOFUNEVER picture NOFUNEVER  路  106Comments

Byloth picture Byloth  路  56Comments

patriksvensson picture patriksvensson  路  143Comments

CobusKruger picture CobusKruger  路  60Comments