Skip to content

Instantly share code, notes, and snippets.

@zzilch
Last active September 28, 2019 07:09
Show Gist options
  • Save zzilch/af65c683c02d62758635bb56800adaf9 to your computer and use it in GitHub Desktop.
Save zzilch/af65c683c02d62758635bb56800adaf9 to your computer and use it in GitHub Desktop.
Windows-Terminal-Settings

Windows-Terminal-Settings

Regedit Import:

Create %USERPROFILE%\\AppData\\Local\\terminal\\wt.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Windows terminal here"
"Icon"="%USERPROFILE%\\AppData\\Local\\terminal\\wt_32.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="%LOCALAPPDATA%\\Microsoft\\WindowsApps\\wt.bat"

Windows Terminal Lanuch Script:

Create %USERPROFILE%\\AppData\\Local\\terminal\\wt.bat

set WT_STARTING_DIR=%cd%
start %LOCALAPPDATA%\\Microsoft\\WindowsApps\\wt.exe
exit

Enter the specific directory

Method 1: for all kinds of shell

Windows Terminal - Setting - profiles.json

    "profiles":
    [
      {
        "name": "Windows PowerShell",
        "startingDirectory": "%WT_STARTING_DIR%",  # set starting dir
        "fontface": "Cascadia Code"                # set font
        "background": "#0C0C0C", 
        "useAcrylic": true,
        "acrylicOpacity": 0.75  
      },
      {
        "name": "cmd",
        "startingDirectory": "%WT_STARTING_DIR%",  # set starting dir
        "fontface": "Cascadia Code"                # set font
      }
    ]

Method 2: only for powershell

Create/Edit Powershell Profile: %USERPROFILE%\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1

if ([System.Environment]::GetEnvironmentVariable("WT_STARTING_DIR")) {
   cd $env:WT_STARTING_DIR
   Remove-Item Env:\WT_STARTING_DIR
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment