Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Outputting colored zsh prompts from an external script
- X-seq: zsh-workers 31179
- From: Christian Neukirchen <chneukirchen@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Outputting colored zsh prompts from an external script
- Date: Mon, 25 Mar 2013 16:42:25 +0100
- In-reply-to: <CAMvu5b+RCigGy-rjtyQB_H_vYF1MPC4PjEW0NBgFYrJEYnViZw__868.462134576653$1364217014$gmane$org@mail.gmail.com> (seanh's message of "Mon, 25 Mar 2013 14:05:42 +0100")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20130324192345.GA20437@kaeru> <871ub431wq.fsf@gmail.com> <CAMvu5b+RCigGy-rjtyQB_H_vYF1MPC4PjEW0NBgFYrJEYnViZw__868.462134576653$1364217014$gmane$org@mail.gmail.com>
- Sender: chris@juno
seanh <snhmnd@xxxxxxxxx> writes:
>> I ported this to zsh for fun:
>>
>> fishpwd() {
>> local maxlen=${1:-20} pwd
>> local -a segs
>>
>> segs=("${(s:/:)${(D)PWD}}")
>>
>> for i in {1..$(($#segs-1))}; do
>> pwd=${(j:/:)segs}
>> (( $#pwd <= maxlen )) && break
>>
>> segs[$i]=${segs[$i][1]}
>> done
>>
>> print $pwd
>> }
>
> Yeah. I know that everything I want to do with zshprompt.py can be
> done in pure zsh and I'm sure it can even be done elegantly in zsh.
> The prompt I'm using right now, until I get zshprompt.py colors
> working, is a pure zsh prompt that I implemented that has most of
> zshprompt.py's features.
>
> But the problem is that your zsh code is completely meaningless to me
> because I don't know zsh. If I learned zsh well enough to do the
> prompt I want, the in six months' time when I want to change my
> prompt or fix a bug I'll have forgotten all about it again because I
> won't have used zsh scripting since. I write Python every day, so
> being able to define zsh prompts by calling external programs (python
> or otherwise) seems really empowering for letting more people hack
> their zsh prompts.
>
> So far this color issue is the only thing getting in my way...
Then try generating "%F{...}" codes like in my other mail. It works here.
--
Christian Neukirchen <chneukirchen@xxxxxxxxx> http://chneukirchen.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author