Alberto Moral bio photo

Alberto Moral

Mobile Developer

Email Twitter Facebook Google+ LinkedIn Instagram Github Stackoverflow

Abstract: iTerm, oh-my-zsh, Terminal, Console, Bash, zsh

I installed a new cool terminal, like @KrauseFx has. There are some steps:

  • Install iTerm2
  • Install oh-my-zsh

    run the following command in your terminal
code sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

or

sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

When you have installed oh-my-zsh, edit the ./zshrc file with vim (or another editor)

vim ~/.zshrc

and change the theme to “agnoster”

ZSH_THEME="agnoster"

then, if you open a new terminal you will see question mark symbols, don’t be scared! we’ll fix that in the next steps

  • Install Solarized a new terminal colors
    Download the latest package, and in iTerm2 preferences, within profiles select the section menu Colors, and import the two Solarized colors for iTerm2.
git clone https://github.com/milkbikis/powerline-shell

Copy config.py.dist to config.py and edit it to configure the segments you want. Then run the next command:

./install.py

Create a symlink to this python script in your home:

ln -s /Users/Moral/powerline-shell/powerline-shell.py ~/powerline-shell.py

Add the following to your .zshrc file:

function powerline_precmd() {
    PS1="$(~/powerline-shell.py $? --shell zsh 2> /dev/null)"
}

function install_powerline_precmd() {
  for s in "${precmd_functions[@]}"; do
    if [ "$s" = "powerline_precmd" ]; then
      return
    fi
  done
  precmd_functions+=(powerline_precmd)
}

if [ "$TERM" != "linux" ]; then
    install_powerline_precmd
fi

And now, close and open iTerm2, you will see a new style within your terminal 😁.