Skip to content

Instantly share code, notes, and snippets.

@DamChtlv
Last active August 8, 2023 16:14
Show Gist options
  • Save DamChtlv/0fa7be8b9fc04a7547b37799e5576af9 to your computer and use it in GitHub Desktop.
Save DamChtlv/0fa7be8b9fc04a7547b37799e5576af9 to your computer and use it in GitHub Desktop.
WSL Terminal Configuration setup on Windows 10 / Ubuntu (Hyper, VSCode)

hyper-config

Update system deps

sudo apt-get update && sudo apt-get dist-upgrade

Install deps

sudo apt-get install build-essential screenfetch zsh

Install Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Configure terminals (Hyper, VSC...)

  • Use this shell exec : C:/Windows/System32/wsl.exe with shell args [--exec] (instead of bash.exe because you can't change default shell otherwise)
  • Use this font family : Fira Code (or Operator Mono powerfont patched if you have it)

Hyper specific config


Hyper config shortcut : Ctrl + ,

  • Fix some render issues in Hyper by setting webGLRenderer: false,
  • Add those plugins :
plugins: [
  "hyper-material-theme",
  "hyperpower",
  "hyper-single-instance",
  "hyper-tabs-enhanced"
],

Set zsh as default shell

chsh -s $(which zsh)

Configure ~/.zshrc config & theme

  • Select a Powerlevel9k theme and add corresponding settings in the config : https://github.com/Powerlevel9k/powerlevel9k/wiki/Show-Off-Your-Config (i usually use this one : https://github.com/da-edra/dotfiles/blob/master/.zshrc)

  • Install Powerlevel10k (because way more performant than P9K) : git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

  • Set ZSH_THEME=powerlevel10k/powerlevel10k in the config

  • Disable P10K Wizard Config by adding this at the end : POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true

  • To fix weird green background text color, add this at the end : LS_COLORS="ow=01;36;40" && export LS_COLORS

  • Fix for VSCode Terminal unsetopt BG_NICE

  • Add aliases to use correct versions of tools from Windows instead of Ubuntu :

alias hyper="cmd.exe /c hyper"
alias pip="cmd.exe /c pip"
alias python="cmd.exe /c python"
  • Add system infos at the top when terminal is launched : screenfetch

WSL2

Set correct permissions for files / folders recursively

sudo chown -R my_username my_folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment