无法更改 zsh 提示

Ale*_*nko 2 zsh 11.10

出于某种原因,我无法通过键入来更改我的 zsh 提示,例如,PS1="%#". 我在 Ubuntu 11.10 上使用管理员建议的配置。我做错了还是一个错误?

这是我的 ~/.zshrc 的内容:

# Set up the prompt

autoload -Uz promptinit
promptinit
prompt adam1
#PS1="`echo "$PS1" | tr Kk Ff`"
#PS2="`echo "$PS2" | tr Kk Ff`"
#PS3="`echo "$PS3" | tr Kk Ff`"
#PS4="`echo "$PS4" | tr Kk Ff`"

setopt histignorealldups sharehistory

# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e

# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history

# Use modern completion system
autoload -Uz compinit
compinit

zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=2
eval "$(dircolors -b)"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true

zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
Run Code Online (Sandbox Code Playgroud)

Gil*_*il' 7

提示主题PS1precmd钩子中重置,特别是通过precmd_functions. 如果您想设置自己的提示,则根本不要使用提示主题:注释掉 aboutpromptinitprompt adam1它们下面的两行。如果要使用提示主题,请使用它们自己的自定义功能。如果您想要一些非常花哨的主题并且预先存在的主题之一适合您,那么使用提示主题会更好,如果您想要简单或高度自定义的提示,则设置自己的主题会更好。