WSL 中文乱码问题的解决
使用 WSL 尤其是 Ubuntu 系统时,使用 ls 显示 /mnt/ 下的目录如果有中文,可能会显示乱码(具体可能是 Unicode 编码)。
问题解决方法
可尝试在终端中执行以下命令,设置编码为 UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8 使用 WSL 尤其是 Ubuntu 系统时,使用 ls 显示 /mnt/ 下的目录如果有中文,可能会显示乱码(具体可能是 Unicode 编码)。
可尝试在终端中执行以下命令,设置编码为 UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8 zsh 是一个强大的 shell,具有很多强大的功能,如自动补全、语法高亮、命令提示等。
zsh 官网:https://www.zsh.org/
# 查看系统存在的shell
cat /etc/shells
# 查看当前使用的shell
echo $SHELL
# 安装zsh
sudo apt install -y zsh
# 切换默认shell,重启终端生效(断开ssh重新连接)
chsh -s $(which zsh)
# 确认是否切换成功
echo $SHELL
oh-my-zsh 是 zsh 的插件管理器,可以方便的安装各种主题和插件
sudo apt install git -y
sh -c "$(curl -fsSL https://ghproxy.net/https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 下载失败可以尝试以下命令
curl -Lo oh-my-zsh.sh https://blog.lololowe.com/file/oh-my-zsh.sh
chmod 755 oh-my-zsh.sh
./oh-my-zsh.shpowerlevel10k 是一款灵活,开箱即用的 zsh 主题
# powerlevel10k主题
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
# zsh-autosuggestions自动提示插件
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# zsh-syntax-highlighting语法高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 下载失败可以尝试以下命令
git clone https://ghproxy.net/https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
git clone https://ghproxy.net/https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://ghproxy.net/https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightingp10k 主题自带的一些图标需要特殊字体支持,推荐使用 MesloLGS 字体,这样在进行某些文档的格式转换时,能调用到这些图标。
如果使用 SSH 客户端连接 SSH 服务器,则 SSH 客户端也需要安装字体,否则无法正常显示 SSH 服务器的图标
# 下载字体
wget https://mirror.ghproxy.com/https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf &&
wget https://mirror.ghproxy.com/https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf &&
wget https://mirror.ghproxy.com/https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf &&
wget https://mirror.ghproxy.com/https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf
# 安装字体
sudo mkdir /usr/share/fonts/truetype/MesloLGS
sudo mv *.ttf /usr/share/fonts/truetype/MesloLGS
# 安装fontconfig工具
sudo apt install fontconfig
# 刷新字体缓存
fc-cache -fv
# 测试字体显示
echo $'\uf115' # 能打印出文件夹图标则成功1.5. 应用主题和插件
# 编辑配置文件,修改主题和插件
vim ~/.zshrc
# 修改主题
ZSH_THEME="powerlevel10k/powerlevel10k"
# 启用插件
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)编辑并保存后,重启终端即可进入 p10k 主题的交互式配置向导,也可以执行 p10k configure 命令进行配置。
转自:https://blog.lololowe.com/posts/dd02/
安装适用于WSL的显卡驱动即可调用显卡
由于Android子系统 使用了和WSL2相同的技术,所以GPU加速需要“WDDM>=2.9且支持Cuda on WSL”的显卡驱动,所以别说子系统GPU支持有问题了
intel核显WSL驱动链接:https://www.intel.com/content/www/us/en/download/19344/intel-graphics-windows-10-windows-11-dch-drivers.html
n卡WSL驱动链接:https://developer.nvidia.com/cuda/wsl/download
a卡WSL驱动链接:https://www.amd.com/en/support/kb/release-notes/rn-rad-win-wsl-support
部分PC由于不带OpenCL和OpenGL,还需要去商店安装扩展包:https://www.microsoft.com/store/productId/9NQPSL29BFFF
搬运自:https://bbs.pcbeta.com/viewthread-1908324-1-1.html