Skip to content

Instantly share code, notes, and snippets.

@Ammar-Azman
Last active June 20, 2023 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ammar-Azman/b08478dac31168302e7cace6b4b3edad to your computer and use it in GitHub Desktop.
Save Ammar-Azman/b08478dac31168302e7cace6b4b3edad to your computer and use it in GitHub Desktop.
Resetting my oh-my-zsh on WSL Ubuntu 20.06.4 after lose it on installing oh-my-posh on PowerShell

Title: Troubleshoot zsh

Datetime

31/5/2023, 11:34 am

Issue

I just want to decorate my Powershell on Windows with oh-my-posh. It worked well, but when I opened my WSL Ubuntu 20.06.4, suddenly it initialized with bash and not zsh. It also change the default user to root instead of ammar-user that I have created at the beginning of installing WSL.

After 4 hours troubleshooting, I found the solution as below.

Solution

  1. Reinstall zsh with sudo apt install zsh, as oh-my-zsh is the framework of zsh.
  2. Make it as default shell with chsh -s $(which zsh).
  3. Reinstall oh-my-zsh with
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. On the terminal, run ubuntu2004.exe config --default-user <my_username> to make the user as default user instead of root.
  2. Restart the terminal (close and open).

Additional

  • If the above method has not changed anything, open .zshrc file, ensure that
  1. The theme is in the following manner;
# User configuration
ZSH_THEME="steeef"
  1. Put this line at the end of file (that actually save my troubleshoot!)
source $ZSH/oh-my-zsh.sh

Source

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