MENU

wsl2中zsh提示:zsh: corrupt history file /root/.zsh_history

June 3, 2022 • linux相关,Windows

问题

  1. wsl2中安装zsh+ohmyzsh+openlevel10k,突然提示:

    zsh: corrupt history file /root/.zsh_history
  2. .p10k.zsh 每次启动zsh都会弹一堆警告

    typeset -g POWERLEVEL9K_INSTANT_PROMPT=off

解决

  1. $HOME目录下依次执行:

    cp .zsh_history zsh_history
    rm -f .zsh_history 
    strings zsh_history .zsh_history
  2. 编辑$HOME目录下的 .p10k.zsh 配置文件,在末尾加上一句:

    typeset -g POWERLEVEL9K_INSTANT_PROMPT=off