31/5/2023, 11:34 am
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.
- Reinstall
zsh
withsudo apt install zsh
, asoh-my-zsh
is the framework ofzsh
. - Make it as default shell with
chsh -s $(which zsh)
. - Reinstall
oh-my-zsh
with
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- On the terminal, run
ubuntu2004.exe config --default-user <my_username>
to make the user as default user instead ofroot
. - Restart the terminal (close and open).
- If the above method has not changed anything, open
.zshrc
file, ensure that
- The theme is in the following manner;
# User configuration
ZSH_THEME="steeef"
- Put this line at the end of file (that actually save my troubleshoot!)
source $ZSH/oh-my-zsh.sh