Have different zsh themes for terminal and iTerm -


here problem. using agnoster theme in zsh. looks great in iterm looks in terminal.

ugly terminal

in other words looks ugly. interested in 2 kinds of solutions:

  1. have different zsh themes terminal , iterm. can use agnoster iterm , other theme terminal. (for example: robbyrussell looks fine in terminal have agnoster iterm , robbyrussell terminal.

  2. make modifications agnoster looks fine in terminal.


i got work, apparently missing whitespace in if condition, rendered useless. here how looks in zshrc

if [ "$term_program" = "apple_terminal" ];     zsh_theme="robbyrussell" else     zsh_theme="agnoster" fi 

terminal , iterm set environmental variable term_program.

terminal : apple_terminal

iterm : iterm

if use pathfinder's terminal, term_program unset.

open oh-my-zsh configuration , use following construction:

ohmythemes=(     # favourite themes )   [ "$term_program" = "iterm" ] && ohmythemes+=agnoster  zsh_theme=${ohmythemes[(($random % ${#ohmythemes} + 1))]} # chooses theme among favourite randomly 

as far know zsh, assume know least bit of shell scripting , can adjust code.

related question : get terminal application name shell


Comments