3
votes
1answer
41 views

bash's command number ( \# ) equivalent in zsh

I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
6
votes
3answers
491 views

Removing the useless space at the end of the right prompt of zsh ($RPROMPT)

In zsh, there is always a space character at the right of my right prompt. I tried with a very simple .zshrc such as: PROMPT="#" RPROMPT="*" There is a always a space after the * on the right of ...
2
votes
2answers
346 views

How to prevent zsh from showing environment variable name instead of current path?

I'm using "oh-my-zsh". I have an environment variable set to the current path, let's say: PROJECT=/home/me/projects/client/project and my zsh prompt looks like this: me@my-machine:~PROJECT$ ...
0
votes
1answer
272 views

Zsh customized prompt and updating variable's value

I would like to use the value of a variable set in my zsh shell to display in my prompt line. For example, let's say export TOKEN='hello' is set in my session. At that time, I load my prompt which ...
2
votes
1answer
264 views

Prevent zsh from setting the current prompt to the name of the variable that points to this path

This is related to Zsh: Open a new tab in the same directory. I have installed oh-my-zsh recently and it certainly kicks. I have some custom variables, like $WORKSPACE which I use to get around ...
0
votes
0answers
79 views

Why is a “-1” appearing on right side of my zsh Terminal prompt?

Screenshot here I recently switched over from bash to zsh for my Terminal shell, however after using it for about a week this "-1" started appearing on the right hand side of my window. It get's ...
7
votes
1answer
3k views

How can I put a newline in my zsh prompt without causing terminal redraw issues?

I'm trying to fix a minor (but annoying) issue with my zsh prompt. The problem I'm seeing is that when I'm using a terminal in a GUI OS environment (for example, Terminal.app or iTerm 2 on OS X ...
8
votes
2answers
2k views

zsh right-justify in ps1

I'd like a multi-line zsh prompt with a right alined part, that will look something like this: 2.nate@host:/current/dir 16:00 -> I know about ...
21
votes
2answers
6k views

Tmux and ZSH custom prompt : bug with window name

I have customized my ZSH prompt with oh-my-zsh to make it more readable and add information about git if I'm in a repository. Example : bob@inf [~/docs] % bob@inf [~/src/nicest] master % (in a git ...
4
votes
3answers
2k views

Get Function Into PS1 (Zsh)?

This works in Bash (parse_git_branch is a defined function) export PS1="\$(parse_git_branch)" but I cannot figure out the equivalent in zsh. Note: If I do PROMPT="$(parse_git_branch)" it seems ...
1
vote
2answers
654 views

in zsh, how do I get pwd in my prompt?

I've recently switched from bash to zsh, but it annoys me that I can't see what directory I'm in (MacOSX) how do I get 'pwd' to show up in my prompt?
2
votes
2answers
2k views

Default prompt for Zsh in Ubuntu

How can you get the prompt "/home/user@address:/path" for Zsh? I run the following unsuccessfully in my .zshrc PROMPT='%d%>:%{\e[0m%} ' I get as my prompt /home/masi