Home > Tech > Mac OS X and zsh and the adam2 prompt theme

Mac OS X and zsh and the adam2 prompt theme

I’m a zsh fan. My zshrc is 1033 lines long. People go wow when they see my shell.

I’m also a fan of zsh themes, especially the adam2 theme. My root prompt is bright red, my prompt on Pioneer is white whereas the prompt on Hertz is white. I love zsh.

Imagine my stupor when the adam2 theme stopped displaying properly when I updated to Mac OS X 10.3 (Panther)

Basically, my prompt was cut off. The host didn’t show when I had less than 110 cols:


.-(~)—————————————————————-
`–> echo $COLUMNS
109

and the middle dashes weren’t shown when I did:


.-(~)-(stereo@Apollo)-
`–> echo $COLUMNS
110

The prompt string on my mac was strange. The PS1 on my debian box was very different. This was on my mac:


%{^[[01;37m%}.%{^[[22;37m%}-%{^[[01;30m%}(%{^[[01;36m%}%~%{^[[01;30m%})%{^[[22;37m%}-%{^[[01;30m%}(%{^[[22;36m%}%n%{^[[01;36m%}@%{^[[22;36m%}%m%{^[[01;30m%})%{^[[22;37m%}-\n%{^M%}%{^[[01;37m%}\`-%{^[[22;37m%}-%{^[[01;37m%}%{^[[01;37m%}%(!.#.>) %{^[[01;32m%}

The solution is to simply copy the prompt_adam2_setup file from another box. I copied the one from my debian box with sudo scp stereo@debian:/usr/share/zsh/4.1.1/functions/Prompts/prompt_adam2_setup /usr/share/zsh/4.1.1/functions/prompt_adam2_setup but you can just use this.

Categories: Tech Tags:
  1. July 24th, 2004 at 21:26 | #1

    Or you can type this on Mac OS X, after looking at the file to make sure I’m not doing anything evil:

    sudo curl -o /usr/share/zsh/4.1.1/functions/prompt_adam2_setup http://www.stereo.lu/prompt_adam2_setup