Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to stop dir expansion in the prompt?
- X-seq: zsh-users 19331
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: How to stop dir expansion in the prompt?
- Date: Mon, 03 Nov 2014 23:36:51 -0800
- In-reply-to: <CAJQX3DzO+M4E7saUp1dBWGmrUYws3vYRASj=Bq2Euj7vRd6Qkg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAJQX3DyxOGy=_B4hSRcVSkea=k0V=8Am+ri4_khJ5Hwy5bMnnQ@mail.gmail.com> <141103194346.ZM32278@torch.brasslantern.com> <CAJQX3DzO+M4E7saUp1dBWGmrUYws3vYRASj=Bq2Euj7vRd6Qkg@mail.gmail.com>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author