DEV Community

Make your terminal look Swag with MSYS2 and ZSH

Shrihan on November 19, 2020

Yeah, I know, I know; you can use Bash on Ubuntu on Windows via WSL, but this article is specially for users using Windows 8.1 and below ...
Collapse
 
rescenic profile image
Muhammad Ridwan Hakim, S.T.

I prefer mintty. Install zsh, oh-my-zsh, and powerlevel10k in msys2. Just set "LOGINSHELL=zsh" in msys2_shell.cmd file. You can also append Windows paths (environment) to MSYS2 environment.
msys2
msys2env

Collapse
 
yury_a868b3d078 profile image
yury burkouski • Edited

good catch, but conemu/wezterm is better ;) but yeah, the correct way to start is

C:\msys64\msys2_shell.cmd -defterm -here -no-start -ucrt64

Instead of author’s "sh -login" and we need to modify msys2_shell.cmd to use zsh

Collapse
 
shrihankp profile image
Shrihan

Mintty is the default emulator for MSYS. It comes bundled with the installer and is installed along with MSYS base system. Of course it's a great choice!

Collapse
 
stephenasamoah profile image
Stephen Asamoah

After the step to "Authorize signing key", I get this error when I ran 'pacman Syyuu':
error: git-for-windows: signature from "Johannes Schindelin <johannes.schindelin@gmx.de>" is unknown trust

Collapse
 
shrihankp profile image
Shrihan

Hi. It seems the signatures have changed since writing the article.

Please see this: github.com/git-for-windows/git/wik...

Collapse
 
yury_a868b3d078 profile image
yury burkouski • Edited

Here I again, have to say that powerlevel10k works too slow and hangs sometimes completely. But 'starship' is a good alternative.
just add in .zshrc after installation

export STARSHIP_CONFIG=~/.config/starship.toml
eval "$(starship init zsh)"

Collapse
 
yury_a868b3d078 profile image
yury burkouski

I successfully installed it using 'git for windows'. Need to start msys as

"C:\Program Files\msys64\msys2_shell.cmd" -defterm -use-full-path -here -no-start -ucrt64
Enter fullscreen mode Exit fullscreen mode

-use-full-path - means 'export full current PATH from environment into MSYS2', as mine win git was installed accordingly and available in win terminal by default without ‘git bash here’ (or how it’s named now).
So the whole setup becomes easier.
And change to

"LOGINSHELL=zsh" 
Enter fullscreen mode Exit fullscreen mode

in msys2_shell.cmd file

Collapse
 
furopi profile image
furopi

Great tutorial! Thanks!!! <3

Collapse
 
shrihankp profile image
Shrihan

You're welcome!

Collapse
 
fatihaziz profile image
Fatih Aziz • Edited

YOUR TUTORIAL IS THE BEST!!!
i'd try so many tutorial so i can use oh-my-zsh to my vscode on windows 10 home edition.
only yours is work!

Thank you very much for helping me!

Collapse
 
shrihankp profile image
Shrihan

You're welcome brother!