Article 5P5MR Explanation of scripting string..

Explanation of scripting string..

by
072aar
from LinuxQuestions.org on (#5P5MR)
Hi I was wondering what this string does--I found it while trying to learn about building a zsh prompt. The FULL line of code is like so:
Code:PS1='%K{green}$left${(l,COLUMNS-${#${(%)left}},)${${:-$branch | $mode}//[%]/%%}}%k$ 'I understand PS1 and the %K and $left but the part I'm needing help with is:

Code:${(l,COLUMNS-${#${(%)left}},)${${:-$branch | $mode}//[%]/%%}}%k$ 'Or, what do I need to read in the zsh manual to understand this line of code. I'm trying to build a prompt like this--I don't need the 'insert' mode; I want user@host for leftprompt, date/time as right prompt and the pwd on a newline. I need a solid bar between left and right prompt:
Attachment 37126
Any input greatly appreciated for this noob. :)
Attached Thumbnailsattachment.php?attachmentid=37126&stc=1& latest?d=yIl2AUoC8zA latest?i=9FtqypbmSkg:kcpBEQgO4Z8:F7zBnMy latest?i=9FtqypbmSkg:kcpBEQgO4Z8:V_sGLiP latest?d=qj6IDK7rITs latest?i=9FtqypbmSkg:kcpBEQgO4Z8:gIN9vFw9FtqypbmSkg
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments