ZSH를 실행할 때마다 표시되는 메시지 제거(oh-my-zsh 설치)

ZSH를 실행할 때마다 표시되는 메시지 제거(oh-my-zsh 설치)

나는 항목을 간소화 .zshrc하고 정리하기 로 결정했습니다 oh-my-zsh. 이제 참조된 플러그인을 자동으로 설치하고 자동으로 업데이트하는 것이 가능한 것 같습니다 zsh. 이것이 제가 원하는 것입니다. 그러나 터미널을 실행할 때마다 다음과 같은 출력이 나타납니다.

[zplug] Start to update 0 plugins in parallel


[zplug] Elapsed time: 0.0074 sec.
 ==> Updating finished successfully!

확실히 필요하지 않으며 제거하고 싶습니다.

.zshrc다음은 항목이 있는 섹션입니다 oh-my-zsh.

# Check if zplug is installed
[ ! -d ~/.zplug ] && git clone https://github.com/zplug/zplug ~/.zplug
source ~/.zplug/init.zsh && zplug update

zplug 'zplug/zplug',    hook-build:'zplug --self-manage'
zplug "seebi/dircolors-solarized", ignore:"*", as:plugin
zplug "plugins/mvn",    from:oh-my-zsh
zplug "plugins/gradle", from:oh-my-zsh
zplug "plugins/git",    from:oh-my-zsh
zplug "plugins/sudo",   from:oh-my-zsh
zplug "plugins/dnf",    from:oh-my-zsh

# Supports checking out a specific branch/tag/commit
zplug "b4b4r07/enhancd", at:v1

# Support bitbucket
zplug "b4b4r07/hello_bitbucket", \
    from:bitbucket, \
    as:command, \
    use:"*.sh"

zplug "zsh-users/zsh-completions",              defer:0
zplug "zsh-users/zsh-autosuggestions",          defer:2, on:"zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting",      defer:3, on:"zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search", defer:3, on:"zsh-users/zsh-syntax-highlighting"

# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
    printf "Install? [y/N]: "
    if read -q; then
        echo; zplug install
    fi
fi

# Then, source plugins and add commands to $PATH
zplug load

답변1

코드 리뷰를 기반으로https://github.com/zplug/zplug, 이러한 메시지는 zplug에서 printf를 통해 stdout으로 전송되므로 다음 줄을 변경하여 메시지를 음소거할 수 있습니다.

source ~/.zplug/init.zsh && zplug update

이를 위해:

source ~/.zplug/init.zsh && zplug update > /dev/null

업데이트를 완전히 비활성화하려면 업데이트 명령을 제거하십시오.

source ~/.zplug/init.zsh

관련 정보