Skip to content

Instantly share code, notes, and snippets.

@sempostma
Last active April 13, 2024 01:48
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sempostma/e4e4add7bdadeb384816102afa43c4b1 to your computer and use it in GitHub Desktop.
Save sempostma/e4e4add7bdadeb384816102afa43c4b1 to your computer and use it in GitHub Desktop.
Windows Terminal with Powerline

Windows Terminal with Powerline

Result

Install the Windows Terminal App

Install the Windows Terminal from the Microsoft Store. This allows you to always be on the latest version.

Powerline setup

  • Install Cascadia code PL font. (otherwise you might some gibberish on your terminal )
  • Git for Windows

Settings

Open the Windows Terminal and press the down arrow right next to the tab and click "Settings". Add the following code to your settings.json file under profiles.list:

{
  "closeOnExit" : true,
  "colorScheme" : "Calamity",
  "commandline" : "\"%PROGRAMFILES%\\git\\bin\\bash.exe\" --login -i -l",
  "guid" : "{00000000-0000-0000-0000-000000012345}",
  "icon" : "%PROGRAMFILES%\\git\\mingw64\\share\\git\\git-for-windows.ico",
  "name" : "Git Bash",
  "tabTitle": "Git Bash",
  "historySize" : 9001,
  "padding" : "0, 0, 0, 0",
  "cursorColor" : "#FFFFFF",
  "cursorShape" : "bar",
  "startingDirectory": "C:\\\\Apps",
  "backgroundImageOpacity": 0.2,
  "acrylicOpacity": 0.8,
  "useAcrylic": true,
  "fontFace": "Cascadia Code PL",
  "fontSize": 14
}

Change the "startingDirectory" to your preferred directory and the following property to defaultProfile:

"defaultProfile": "{00000000-0000-0000-0000-000000012345}"

And add the following color scheme to the schemes array:

{
  "name": "Calamity",
  "black": "#2f2833",
  "red": "#fc644d",
  "green": "#a5f69c",
  "yellow": "#e9d7a5",
  "blue": "#3b79c7",
  "purple": "#f92672",
  "cyan": "#74d3de",
  "white": "#d5ced9",
  "brightBlack": "#7e6c88",
  "brightRed": "#fc644d",
  "brightGreen": "#a5f69c",
  "brightYellow": "#e9d7a5",
  "brightBlue": "#3b79c7",
  "brightPurple": "#f92672",
  "brightCyan": "#74d3de",
  "brightWhite": "#ffffff",
  "background": "#2f2833",
  "foreground": "#d5ced9"
}

Now close the Windows Terminal App and restart.

After that you can run the following command:

cd $HOME
mkdir -p .bash/themes/git_bash_windows_powerline
git clone https://github.com/diesire/git_bash_windows_powerline.git .bash/themes/git_bash_windows_powerline

Add the following code to your .bashrc file inside the user's directory and once again, restart:

# Theme
THEME=$HOME/.bash/themes/git_bash_windows_powerline/theme.bash
if [ -f $THEME ]; then
   . $THEME
fi
unset THEME

Add Powerline to VSCode

Open the command pallete ctrl+shift+p and type >Preferences: Open Settings (JSON) and add or overwrite the following fields with the these values:

"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"terminal.integrated.fontFamily": "Cascadia Code PL"

You may need to restart VSCode if you installed the "Cascadia Code PL" font after you opened VSCode.

Changing the Git Bash font

Open up Git Bash, right click the toolbar, click properties and change the font to "Cascadia Code PL".

Sources

@ZackWhiteIT
Copy link

Thanks for the guide!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment