Windows Terminal Preview - Keybinding for opening a new tab at the current working directory

0

I'm trying to write a command that allows me to open a new Git Bash instance at the current working directory in Windows Terminal Preview.

So far I've tried the following keybind in my settings.json:

// Press Ctrl+Shift+N to open a new tab on current working directory
{ "command": { "action": "newTab", "startingDirectory": "%PWD%" }, "keys": "ctrl+shift+n" }

Which opens a new instance of my default profile (Git Bash in this case), however I get the following error:

[error 0x8007010b al iniciar `"%PROGRAMFILES%\git\usr\bin\bash.exe" -i -l']

Which I tracked to be caused by an invalid "startingDirectory" parameter. I've tried using enviroment variables such as %PWD%, %USERPROFILE%, $PWD, PWD, but none of them seems to work.

Here is the default profile that launches:

  {
    "guid": "{00000000-0000-0000-ba54-000000000002}",
    "acrylicOpacity": 0.75,
    "closeOnExit": true,
    "colorScheme": "flat-ui-v1",
    "commandline": "\"%PROGRAMFILES%\\git\\usr\\bin\\bash.exe\" -i -l",
    "cursorColor": "#FFFFFF",
    "cursorShape": "filledBox",
    "fontSize": 12,
    "historySize": 9001,
    "icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
    "name": "Bash",
    "padding": "0, 0, 0, 0",
    "snapOnInput": true,
    "startingDirectory": "%USERPROFILE%",
    "useAcrylic": true
  }
json
environment-variables
command
git-bash
windows-terminal

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0