blog

How to customize bash inside VSCode on WSL2

I wanted my WSL bash to look the same as the one I have on Windows where I use Git bash for Windows.

Two resources that helped me where this question and answer on StackOverflow and this article with tips about styling bash shell

TL;DR

  1. Add "terminal.integrated.shellArgs.linux": ["-l"] in VSCode settings
  2. Modify prompt in ~/.bashrc (the one located in WSL)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\w\[\033[36m\]$(__git_ps1)\n\[\033[00m\]$ '

This is my final modification that gives me green working dir and cyan branch name and a white caret on a new line.