1. Download Iterm,
Address: http://www.iterm2.com/
Can completely replace the Mac comes with the terminal.
2. Before I had oh-my-zsh,
git clone git://github.com/lokaltog/powerline.git
Edit my ~/.ZSHRC file,
Zsh_theme= "Powerline" #改成这个, and then source ~/.ZSHRC
3. Need font support, otherwise the sharp corner you want to show garbled.
git clone https://github.com/powerline/fonts.git ~/powerline-fonts
Install required.
Choose the font you like in Iterm.
4. Why is that path so long? Oh, it has to be Powerline-shell, a python-written support for Python2 and 3.
Reference here can also: https://linux.cn/article-5249-1.html
But I'm git clone, process as Https://github.com/banga/powerline-shell
5. But for me personally, the username on the shell, and host are not very significant (I do not know I am healer), that time is even more useless.
So, change the configuration:
I joined in ~/.ohmyzsh-powerlinecd/powerline.zsh-theme.
Powerline_right_a= "Exit-status-on-fail" # This change is not necessary.
powerline_disable_rprompt= "Hide" #我觉得右侧的时间显示没啥意思, and when split screen, there are not so many places.
My machine's hostname too long, want to remove, found that this file is useless. Because it was handled by Powerline-shell.
Change ~/powerline-shell.py
Search Add_username_segment and Add_hostname_segment,
Finally, I choose to keep only healer this display.
In addition
This code is put into your. ZSHRC Inside:
function Powerline_precmd () {Export PS1="$ (~/powerline-shell.py $?--shell zsh 2>/dev/null)"}function Install_powerline_precmd () { forSinch "${precmd_functions[@]}"; doif["$s"="Powerline_precmd" ]; Thenreturnfi done Precmd_functions+=(powerline_precmd)}install_powerline_precmd
Mac ITerm with Powerline