5

Installed on my Mac running Yosemite is a few packages to make life in the terminal (iTerm 2) a bit better. I have oh-my-zsh (only plugin I have id antigen for oh-my-zsh) along with oh-my-git installed.

Currently when I run iTerm 2 or Terminal and I'm not in a git repo, I see this:

james.mosier@fs215:~% 9:59 james.mosier@fs215

...in image form below:

screenshot


What I am trying to do is:

1.) remove the timestamp & computer name at the end of the input 2.) change the prefix to (at the very least) remove the % sign

I know my way around the .zshrc, .profile, .bash_profile fairly well, at least for what I want to accomplish above. I just can't seem to find where $PS1 is set with the output below, which I assume is what I should be looking for.

What I've tried...

I have tried to do echo $PS1 which gives me $(build_prompt), then I do echo $(build_prompt) which gives me the output of %n@%m:%~%#. I cannot find this text anywhere within my .zshrc, oh-my-zsh.sh, .prompt.sh, or .base.shfiles.

I have also found the $(build_prompt) but it doesn't appear to contain the formatting for the line I'm looking to change ($(build_prompt)is located in prompt.sh in my oh-my-git plugin, file found here)

Conclusion

In the files I have linked above, is there a pattern or string I can alter to change my terminal's prefix and suffix? Ideally I'd like to get rid of the suffix completely and alter the prefix to just be whatever the default terminal prefix is or ~

1 Answer 1

2

Found the solution after much investigation. It might be a bit speclialized towards my situation, unless you happen to be using antigen, oh-my-zsh, and oh-my-git. But anyway...

The PS1 variable (prefix) is in the theme-and-appearance.zsh, located in .antigen/repos/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh.git/lib

The existing entry is PS1="%n@%m:%~%# " and I changed it to PS1="$ [%~] "


The suffix was a bit harder to find. In the .antigen/repos/https-COLON--SLASH--SLASH-github.com-SLASH-arialdomartini-SLASH-oh-my-git-themes.git/oppa-lana-style.zsh-theme file, I found this variable and commented it out completely: RPROMPT='%{$reset_color%}%T %{$fg_bold[white]%} %n@%m%{$reset_color%}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .