jup*_*bjy 5 colors zsh windows-subsystem-for-linux
使用 Win10 和WSL2 ubuntu 20.04和Powerline10k的各种终端。
\n使用 python 模块rich测试颜色输出。
\n\n正如 Powershell 清楚地显示的那样,Windows 终端可以输出真彩色。\n但是很奇怪,在 WSL2 上,无论我尝试过 win10 上的哪个终端,zsh 都无法打印真彩色。
\n$TERM正确报告 xterm-256color。
\xe2\x9d\xaf env | grep TERM\nTERM=xterm-256color\n\n\xe2\x9d\xaf zsh --version\nzsh --version\nzsh 5.8 (x86_64-ubuntu-linux-gnu)\nRun Code Online (Sandbox Code Playgroud)\n并且没有 env $COLORTERM。
由于到目前为止我无法通过谷歌搜索找到任何修复程序,我假设这可能与 zsh 有关?
\n这是自动生成的.zshrc文件:
\xe2\x9d\xaf cat ~/.zshrc\n# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.\n# Initialization code that may require console input (password prompts, [y/n]\n# confirmations, etc.) must go above this block; everything else may go below.\nif [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then\n source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"\nfi\n\n# If you come from bash you might have to change your $PATH.\n# export PATH=$HOME/bin:/usr/local/bin:$PATH\n\n# Path to your oh-my-zsh installation.\nexport ZSH="/home/nyarukoishi/.oh-my-zsh"\n\n# Set name of the theme to load --- if set to "random", it will\n# load a random theme each time oh-my-zsh is loaded, in which case,\n# to know which specific one was loaded, run: echo $RANDOM_THEME\n# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes\n# ZSH_THEME="powerlevel10k"\n\n# Set list of themes to pick from when loading at random\n# Setting this variable when ZSH_THEME=random will cause zsh to load\n# a theme from this variable instead of looking in $ZSH/themes/\n# If set to an empty array, this variable will have no effect.\n# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )\n\n# Uncomment the following line to use case-sensitive completion.\n# CASE_SENSITIVE="true"\n\n# Uncomment the following line to use hyphen-insensitive completion.\n# Case-sensitive completion must be off. _ and - will be interchangeable.\n# HYPHEN_INSENSITIVE="true"\n\n# Uncomment the following line to disable bi-weekly auto-update checks.\n# DISABLE_AUTO_UPDATE="true"\n\n# Uncomment the following line to automatically update without prompting.\n# DISABLE_UPDATE_PROMPT="true"\n\n# Uncomment the following line to change how often to auto-update (in days).\n# export UPDATE_ZSH_DAYS=13\n\n# Uncomment the following line if pasting URLs and other text is messed up.\n# DISABLE_MAGIC_FUNCTIONS="true"\n\n# Uncomment the following line to disable colors in ls.\n# DISABLE_LS_COLORS="true"\n\n# Uncomment the following line to disable auto-setting terminal title.\n# DISABLE_AUTO_TITLE="true"\n\n# Uncomment the following line to enable command auto-correction.\n# ENABLE_CORRECTION="true"\n\n# Uncomment the following line to display red dots whilst waiting for completion.\n# COMPLETION_WAITING_DOTS="true"\n\n# Uncomment the following line if you want to disable marking untracked files\n# under VCS as dirty. This makes repository status check for large repositories\n# much, much faster.\n# DISABLE_UNTRACKED_FILES_DIRTY="true"\n\n# Uncomment the following line if you want to change the command execution time\n# stamp shown in the history command output.\n# You can set one of the optional three formats:\n# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"\n# or set a custom format using the strftime function format specifications,\n# see \'man strftime\' for details.\n# HIST_STAMPS="mm/dd/yyyy"\n\n# Would you like to use another custom folder than $ZSH/custom?\n# ZSH_CUSTOM=/path/to/new-custom-folder\n\n# Which plugins would you like to load?\n# Standard plugins can be found in $ZSH/plugins/\n# Custom plugins may be added to $ZSH_CUSTOM/plugins/\n# Example format: plugins=(rails git textmate ruby lighthouse)\n# Add wisely, as too many plugins slow down shell startup.\nplugins=(git)\n\nsource $ZSH/oh-my-zsh.sh\n\n# User configuration\n\n# export MANPATH="/usr/local/man:$MANPATH"\n\n# You may need to manually set your language environment\n# export LANG=en_US.UTF-8\n\n# Preferred editor for local and remote sessions\n# if [[ -n $SSH_CONNECTION ]]; then\n# export EDITOR=\'vim\'\n# else\n# export EDITOR=\'mvim\'\n# fi\n\n# Compilation flags\n# export ARCHFLAGS="-arch x86_64"\n\n# Set personal aliases, overriding those provided by oh-my-zsh libs,\n# plugins, and themes. Aliases can be placed here, though oh-my-zsh\n# users are encouraged to define aliases within the ZSH_CUSTOM folder.\n# For a full list of active aliases, run `alias`.\n#\n# Example aliases\n# alias zshconfig="mate ~/.zshrc"\n# alias ohmyzsh="mate ~/.oh-my-zsh"\nsource ~/powerlevel10k/powerlevel10k.zsh-theme\n\n# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.\n[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh\n\nalias py=python3.9\nRun Code Online (Sandbox Code Playgroud)\n