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 Thumbnails
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 Thumbnails