查看装了有哪些shell
cat /etc/shells
安装zsh
sudo apt-get install zsh
chsh -s /bin/zsh # 切换shell
安装oh my zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
切换主题
vi ~/.zshrc
然后就可以设置主题,常用的出题有agnoster、bira等,例如想修改为agnoster主题,修改如下语句即可
ZSH_THEME=“agnoster”
乱码
若使用wsl可能会出现乱码,还需要配置开启特效和字体,配置和解决方法如下
https://www.cnblogs.com/yunzimo/p/14987072.html
首先要下载字体
git clone https://github.com/powerline/fonts.git --depth=1 # windos 下需先安装 git
用powershell运行其中以ps1结尾的文件就会开始安装字体,然后更改配置
profiles中的ubuntu部分需要改为如下内容,主要是这两项
“useAcrylic” : true,
“fontFace” : “Noto Mono for Powerline”,
"profiles":
{
"defaults": {},
"list":
[
{
"commandline": "powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell"
},
{
"commandline": "cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "\u547d\u4ee4\u63d0\u793a\u7b26"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"hidden": false,
"name": "Ubuntu-20.04",
"useAcrylic" : true,
"fontFace" : "Noto Mono for Powerline",
"source": "Windows.Terminal.Wsl"
}
]
},