From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22608 invoked by alias); 4 Nov 2014 07:37:14 -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: 19331 Received: (qmail 21576 invoked from network); 4 Nov 2014 07:37:13 -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.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=HrPBwPXX c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=fHxNSQrH_QbfWUjrnBwA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141103233651.ZM32506@torch.brasslantern.com> Date: Mon, 03 Nov 2014 23:36:51 -0800 In-reply-to: Comments: In reply to Shiyao Ma "Re: How to stop dir expansion in the prompt?" (Nov 4, 2:30pm) References: <141103194346.ZM32278@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: How to stop dir expansion in the prompt? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Nov 4, 2:30pm, Shiyao Ma wrote: } } To replace $HOME with ~, I do this: } PROMPT="%(?.${success_color}.${failure_color})${SSH_TTY:+[%n@%m]}%B%${max_path_chars}<...<"'${${vcs_info_msg_0_%%}/#$HOME/~}'"%<<%(!.${root_char}.${user_char})%b%f } " } } Where am I doing wrong? /#$HOME/ means the pattern has to match at the start of the string. Are you sure the value of $vcs_info_msg_0_ starts with the directory name? Also, why is the %% in the inner expansion? (I guess it was in your original example too, but it's extraneous if there's nothing between it and the closing brace.) } (Does zsh support nested variable expansion?) Yes.