返回文章列表文章索引阅读全文
STARBLOG / 阅读手记
Windows

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

曦远 (DealiAxy)约 5 分钟
目录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

  1. Open Run, type regedit to launch Registry Editor

  2. Find this folder in the registry \HKEY_CLASSES_ROOT\Directory\Background\shell\

  3. 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

  4. 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 .ico and .exe files

  5. Under WSL Shell Here, create a new key named command, 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 许可协议。转载请注明出处!

相关文章

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…