WSL Tips: Switching to zsh and Adding to the Right-Click Menu
Switching to zsh Notes In Windows Subsystem for Linux, running chsh -s /bin/zsh does not successfully change the default shell to zsh. When opening WSL, the default shell is still bash. This is because WSL does not execute login-related components at startup, and these components are related to the default shell. Microsoft is already aware of this issue, but has no plans to fix it. Method We can
目录6 个章节
Switching to zsh
Notes
In Windows Subsystem for Linux, running chsh -s /bin/zsh does not successfully change the default shell to zsh. When opening WSL, the default shell is still bash. This is because WSL does not execute login-related components at startup, and these components are related to the default shell. Microsoft is already aware of this issue, but has no plans to fix it.
Method
We can use a simple workaround to open zsh at the same time when opening WSL. Add the following to ~/.bashrc
bash -c zsh
References
https://github.com/Microsoft/WSL/issues/477
Adding to the Right-Click Menu
-
Open Run, type
regeditto launch Registry Editor -
Find this folder in the registry
\HKEY_CLASSES_ROOT\Directory\Background\shell\ -
Select the shell folder, right-click to create a new key, double-click the Default value, and change it to
WSL Shell Here; this is the name displayed in the right-click menu -
Add a string value under Default, named
Icon, double-click to change its value to the path of the icon you want, which can be.icoand.exefiles -
Under
WSL Shell Here, create a new key namedcommand, and change this key's Default value to the Ubuntu exe file path; mine is"C:\Windows\System32\bash.exe", note that there should be double quotes on both sides

Ps: Why does today's screenshot look like this = =.. Reason: Out and about. Can only use Windows on my laptop
About

For more interesting tips, follow my WeChat official account: DealiAxy Every article is collected on my blog: blog.deali.cn
_EOF_
WSL Tips: Switching to zsh and Adding to the Right-Click Menu
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
使用twinkle-tray快捷调整多个显示器的亮度
自从安装了这个小工具,我再也没用过笔记本键盘上的快捷键了~
2025-01-26 · Windows · 约 1 分钟
2024年,提升Windows开发和使用体验实践 - 小工具篇
本来是一篇文章的,不知不觉写成了系列。 其实开工那几天就已经写好了长文,这几天一忙就没连着发了。 本文介绍一些 Windows 上用的小工具。
2024-02-29 · Windows · 约 1 分钟
在Windows上将git与ssh-agent搭配使用
Windows git 还自带 ssh?真是老土的兼容性思路。一行配置就能解决,不过得先管好 ssh-agent 的连接。 ProxyCommand 居然又添乱,难怪老出毛病。
2025-08-21 · Windows · 约 1 分钟
修复winget命令找不到的问题
微软官方包管理器winget在Windows 10 1809以上版本中,用于快速安装、更新和管理应用程序。本文介绍了因系统环境变化导致winget命令失效的问题,分析了可能原因,并提供了解决方案及预防措施,包括修复命令、定期更新检查、备份环境变量等。
2025-04-04 · Windows · 约 1 分钟
讨论
共 0 条加载评论中…