터미널 시작 속도를 늦추는 요소를 확인하는 방법은 무엇입니까?

터미널 시작 속도를 늦추는 요소를 확인하는 방법은 무엇입니까?

터미널 시작 속도를 늦추는 원인을 확인하는 방법이 있습니까? iTerm2에서 ohmyzsh와 함께 zsh를 사용하고 있습니다.

새 창을 여는 데 약 10초 정도 걸립니다. :(

이것은 내 zshrc 파일입니다.

export PATH=/usr/local/mysql/bin:$PATH
export PATH=$HOME/bin:$PATH
export PATH=$PATH:/usr/local/git/bin/
export HISTFILESIZE=5000
export PYTHONPATH="/usr/local/lib/python2.7/site-packages/:$PYTHONPATH"
#alias ls="ls -G"

export NODE_PATH="/usr/local/lib/node"
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/share/npm/bin:$PATH"

#svndiff() {
#    svn diff $1 | colordiff.pl
#}

#hgdiff() {
#    hg diff $1 | colordiff.pl
#}
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

#PS1="$prompt_style"'${debian_chroot:+($debian_chroot)}\u@\h:\W\$'"$command_style "
#trap 'echo -ne "\033[00m"' DEBUG

export LANG="it_IT.UTF-8"
export LC_COLLATE="it_IT.UTF-8"
export LC_CTYPE="it_IT.UTF-8"
export LC_MESSAGES="it_IT.UTF-8"
export LC_MONETARY="it_IT.UTF-8"
export LC_NUMERIC="it_IT.UTF-8"
export LC_TIME="it_IT.UTF-8"
export LC_ALL=

#export CURL_CA_BUNDLE="$HOME/.curl/cacert.pem"

#Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="cypher"

# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"

# Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"

# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"

# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(fab osx pip django)

source $ZSH/oh-my-zsh.sh

# Customize to your needs...
export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/share/npm/bin:/Users/patrick/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin/:$PATH

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function


alias serve="python -m SimpleHTTPServer"

alias adb="~/Documents/android-sdk-macosx/platform-tools/adb"
alias fastboot="~/Documents/android-sdk-macosx/platform-tools/fastboot"

네, 문제가 많습니다. 문제의 원인이 무엇인지 확인하도록 도와주실 수 있나요?

감사해요 :)

답변1

Apple 시스템 로그를 제거해 보셨나요?

http://ariejan.net/2011/11/08/fixing-a-slow-starting-terminal-or-iterm2-on-mac-os-x/

그래도 문제가 해결되지 않으면 zshrc를 옆으로 치우고 mv .zshrc zshrc.testing모든 줄을 주석 처리하는 속도가 빨라지면 속도가 느려지는 원인을 확인할 때까지 한 번에 하나씩 줄의 주석 처리를 천천히 해제하십시오.

답변2

iTerm2를 사용하면 설정을 통해 초기화를 추적할 수 있습니다.

Preferences -> Profiles -> [Your Profile, or Default] -> General -> Command

"로그인 쉘"에서. 에게:

/bin/zsh -i -x

-x는 프롬프트를 표시하기 전에 실행 중인 .zshrc 명령(및 /etc/profile)을 표시합니다.

iTerm2 로깅을 사용하면 각 명령을 실행한 시간과 함께 기록하고 무엇이 시간을 많이 소비하는지에 대한 일반적인 아이디어를 얻을 수 있습니다.

관련 정보