Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH, take 2: allow configuration of wrap length and number of path elements shown for adam1 prompt



I have much belatedly committed this.

On Mon, Jun 23, 2025 at 8:36 AM <zsh@xxxxxxxxxxxx> wrote:
>
>     The length calculation does not exactly match the expected value of 70;
>     I suspect the string length is including the color escape sequences
>
>     +  base_prompt_etc=$(print -P "$base_prompt%($((${prompt_path_ellipsize_num} + 1))~|...|)%${prompt_path_ellipsize_num}~")
>        prompt_length=${#base_prompt_etc}

This demonstrates just how far out of sync with the latest features
many of these prompt setups have fallen.  In any case $base_prompt_etc
should be based on $base_prompt_no_color to get an accurate value for
$prompt_length, the same way $space_left is (via
$base_prompt_expanded_no_color).

I'll leave that one-word change to you.  The help text should also be
updated to describe $4 and $5:

prompt adam1 [<color1> [<color2> [<color3>]]]




Messages sorted by: Reverse Date, Date, Thread, Author