Skip to main content
Better layout inserted line feeds.
Source Link
Chucky
  • 221
  • 2
  • 4

Although I am a bash user, I find one of zsh's features pretty cool  : RPS1. Remember

Remember:

  • PS1  : the left aligned prompt
  • RPS1  : the right aligned prompt

Sample: When

When using something like PS1=’%B(%h) %m%#%b ‘ RPS1=’(%20<…<%~)' you

PS1=’%B(%h) %m%#%b ‘ RPS1=’(%20<…<%~)' 

You get your prompt on the left and the current directory pushed onto the right. It even disappears when the current line is getting too long, as ! It's because zsh is smart enough to give low priority to RPS1. You

You can see a screenshot of this example at https://i.sstatic.net/W3qDx.jpg.

Although I am a bash user, I find one of zsh's features pretty cool  : RPS1. Remember:

  • PS1  : the left aligned prompt
  • RPS1  : the right aligned prompt

Sample: When using something like PS1=’%B(%h) %m%#%b ‘ RPS1=’(%20<…<%~)' you get your prompt on the left and the current directory pushed onto the right. It even disappears when the current line is getting too long, as zsh is smart enough give low priority to RPS1. You can see a screenshot of this example at https://i.sstatic.net/W3qDx.jpg.

Although I am a bash user, I find one of zsh's features pretty cool: RPS1.

Remember:

  • PS1: the left aligned prompt
  • RPS1: the right aligned prompt

Sample:

When using something like

PS1=’%B(%h) %m%#%b ‘ RPS1=’(%20<…<%~)' 

You get your prompt on the left and the current directory pushed onto the right. It even disappears when the current line is getting too long ! It's because zsh is smart enough to give low priority to RPS1.

You can see a screenshot of this example at https://i.sstatic.net/W3qDx.jpg.

Source Link
Chucky
  • 221
  • 2
  • 4

Although I am a bash user, I find one of zsh's features pretty cool : RPS1. Remember:

  • PS1 : the left aligned prompt
  • RPS1 : the right aligned prompt

Sample: When using something like PS1=’%B(%h) %m%#%b ‘ RPS1=’(%20<…<%~)' you get your prompt on the left and the current directory pushed onto the right. It even disappears when the current line is getting too long, as zsh is smart enough give low priority to RPS1. You can see a screenshot of this example at https://i.sstatic.net/W3qDx.jpg.