mkdir zsh && cd zsh # 新建文件夹 wget https://sourceforge.net/projects/zsh/files/latest/download # 下载最新版本zsh xz -d zsh-5.7.1.tar.xz # .tar.xz 文件需要解压两次 tar -xvf zsh-5.7.1.tar cd zsh-5.7.1 ./configure --prefix="绝对路径(我安装在了 zsh/ 下)"# 指定路径configure make && make install # 安装
2.遇到的问题
① configure 时无 ncurses 依赖
1 2 3 4 5
configure: error: "No terminal handling library was found on your system. This is probably a library called 'curses' or 'ncurses'. You may need to install a package called 'curses-devel' or 'ncurses-devel' on your system." See `config.log' for more details
prompt_context() { if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then prompt_segment black default "%(!.%{%F{yellow}%}.)$USER" fi }
# 只保留主机名,隐藏用户名 prompt_context() { if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then prompt_segment black default "%(!.%{%F{yellow}%}.)$HOST" fi }