From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18240 invoked by alias); 25 Mar 2013 13:06:33 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17737 Received: (qmail 7950 invoked from network); 25 Mar 2013 13:06:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.214.47 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=8z4A49oNdJA6gdCKQcRDueKihO0mGwzqWd0K8ePpKPo=; b=nEY/PA/vIJa8oIkSe4EmH3cXxKcaQUltlfxajc4KTj8rGAmMGbrQz1lKNyDT817PQZ 88Vk5cEltPWHrzckut0qpIO23qjkSmnBKU5PxrSomUSwPU9DMUVI1sA4CmAqPErAWYxZ ZzTR2fb8yZwoKq2UVQ8auVYYNYLcD/YJgyxhvDoBGE65KNxwPDgnChXwDaoF3jS3T2eW vezH4ZzIFxhL9YTunWZPKfxkfnBp9tpfi93g5IgcHmhSXISnhUSShOdetARr6bCerhJA PoTV3bx0GMkKJEIRGFmiXNcLPDHU0ZBiraj4Jco6ssOl5ZNSyd9KB/ki9rZWMZ9qrGVn kz1g== X-Received: by 10.205.141.70 with SMTP id jd6mr5421979bkc.28.1364216784101; Mon, 25 Mar 2013 06:06:24 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <871ub431wq.fsf@gmail.com> References: <20130324192345.GA20437@kaeru> <871ub431wq.fsf@gmail.com> From: seanh Date: Mon, 25 Mar 2013 14:05:42 +0100 Message-ID: Subject: Re: Outputting colored zsh prompts from an external script To: zsh-users@zsh.org Content-Type: text/plain; charset=ISO-8859-1 > 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...