From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25675 invoked by alias); 26 Jul 2013 22:48:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31586 Received: (qmail 26939 invoked from network); 26 Jul 2013 22:48:50 -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=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=DtQlttLhurGWO9Syrhj3HOnyMd19oKMNaCFif+VpuRU=; b=phq1ODhcuXDFStWFU6k5NUcZJbe8YaOaUeUtvnWtmShpFdn75a2U8wcrnFny/28iJMjn/rJlq3F2KhsnGk9Kap8mTK4QHjFOrjeiEVyGpobvj9hhWByWrpxS0DPfEto7/xkde3PWFp9kfqgLQuWmUM/45du0QjLkhvdPw7x+BFQ=; Date: Fri, 26 Jul 2013 18:31:17 -0400 From: Phil Pennock To: Manuel Presnitz Cc: zsh-workers@zsh.org Subject: Re: Bug with named dirs in prompt expansion Message-ID: <20130726223117.GA74369@redoubt.spodhuis.org> Mail-Followup-To: Manuel Presnitz , zsh-workers@zsh.org References: <201307262058360115.008E9ADA@mail.gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307262058360115.008E9ADA@mail.gmx.net> On 2013-07-26 at 20:58 +0200, Manuel Presnitz wrote: > is it just me, or is there a bug in the "%~" prompt expansion: It's the documented, specified behaviour. See zshexpn(1): ----------------------------8< cut here >8------------------------------ Static named directories [...] In certain circumstances (in prompts, for instance), when the shell prints a path, the path is checked to see if it has a named directory as its prefix. If so, then the prefix portion is replaced with a `~' followed by the name of the directory. The shortest way of referring to the directory is used, with ties broken in favour of using a named directory, except when the directory is / itself. The parameters $PWD and $OLDPWD are never abbreviated in this fashion. ----------------------------8< cut here >8------------------------------ > I would expect that after ": ~fooo" the prompt changes to "~fooo>", but it doesn't. The idea of %~ is to find the shortest available name, for a condensed representation so as to concisely convey to the user where they are. > this issue was originally raised here: http://superuser.com/q/624603/195224 I've posted a reply. -Phil