Before starting this, the first thing you need to do is make sure your Windows build is up to date enough.
- Open "Settings" -> "About"
- Scroll to "Windows Specification"
- Make sure OS build is 16215 or higher.
- Run PowerShell as an administrator
- Run the command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
You may need to restart after this.
- Open the Windows store
- Search for "Linux", and various distro choices will come up. The options are:
- Ubuntu
- OpenSUSE
- SLES
- Kali Linux
- Debian GNU/Linux
If you're not supper familiar with Linux, I recommend Ubuntu. The rest of this will be written assuming you're using Ubuntu, although the rest would be fairly similar. Regardless of what you install, this part can take a while.
- Open vscode's settings
- Search for
terminal.integrated.shell.windows
- Change the path to bash or WSL's installed path. This should be
C:/Windows/System32/bash.exe
.
Now when you open your terminal, you should see this:
By this point you should have bash fully working in vscode. The rest of this is to set up the Fish shell to have it look nice and pretty. If you don't want Fish, you're done here.
- Install fish!
sudo apt-get install fish
If you prefer, you can also install from the git repo: https://github.com/fish-shell/fish-shell#building 2. Install the good stuff:
curl -L https://get.oh-my.fish | curl ; Installs the package manager
omf install agnoster ; Installs the agnoster theme - this can be any theme you find here: https://github.com/oh-my-fish/oh-my-fish/blob/master/docs/Themes.md
- Open vscode's settings
- Search for
terminal.integrated.shellArgs.windows
- Change the array value to
["-c", "fish"]
This will make your startup command when you start the shellbash -c fish
- Install Powerline fonts on Windows, not bash
git clone https://github.com/powerline/fonts.git --depth=1
./fonts/install.ps1
If you just want a specific font, check out their git repo
2. Open settings in VSCode
3. Go to terminal.integrated.fontFamily
4. Change the value to one of the supported fonts - ex. "Droid Sans Mono Dotted for Powerline"
NOTE:
Make sure your VS Code is up to date. On Insiders < V 1.30 the fonts won't work in the terminal. I don't know what the minimum version is for regular VS Code, but if the fonts don't work, update and you'll be fine.
Now when you open your terminal you should get this:
- Different themes might have different requirements for fonts and such - make sure you're installing them on your Windows local, not through WSL. WSL can't control it's own font because the actual application is run through Windows.
- You need to be careful about what you're running on WSL because it cannot touch ANY gui applications. All you have access to in it is the linux command line utilities. If you want to edit something for example, it'll need to be through Vim or another editor.
- The WSL file system is very difficult (if possible at all?) to interact with through Windows. Save your files in Windows and access them through WSL, not vice versa. For example you can't use a WSL path to your Python interpereter for getting Python linting in an IDE - Windows applications can't see into WSL.
If any of this doesn't work, please let me know!