Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Prompt expansion: $((%)foo} != $(print -P $foo)
- X-seq: zsh-workers 10181
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Prompt expansion: $((%)foo} != $(print -P $foo)
- Date: Mon, 20 Mar 2000 17:11:22 +0000
- In-reply-to: <200003201204.NAA10508@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <200003201204.NAA10508@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Mar 20, 1:04pm, Sven Wischnowsky wrote:
} Subject: Re: Prompt expansion: $((%)foo} != $(print -P $foo)
}
} Bart Schaefer wrote:
}
} > The order in which parameter expansion vs. prompt %x expansion takes place
} > appears to be reversed for ${(%)...} and $(print -P ...).
}
} Err... that's what (%%) is for.
D'oh! I should have remembered that ...
Index: Functions/Prompts/prompt_bart_setup
===================================================================
@@ -60,19 +60,10 @@
psvar[8]="$history[$#history]" # Use history text, not just number
psvar[9]='' # Padding before upper right prompt
- if [[ -o promptsubst ]]
- then
- # This is a bug workaround; ${(%)...} mishandles promptsubst
- repeat $[COLUMNS-${#${(%f)${${(e)PS1}//[%]\{[^%]#%\}/}}[1]}-1]
- do
- psvar[9]="$psvar[9] "
- done
- else
- repeat $[COLUMNS-${#${(%f)${PS1//[%]\{[^%]#%\}/}}[1]}-1]
- do
- psvar[9]="$psvar[9] "
- done
- fi
+ repeat $[COLUMNS-${#${(%%f)${PS1//[%]\{[^%]#%\}/}}[1]}-1]
+ do
+ psvar[9]="$psvar[9] "
+ done
}
prompt_bart_ps1 () {
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author