Re: [dev][st] Approach to adding -bg colour option to st

From: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
Date: Tue, 26 Apr 2011 21:21:33 +0200

On Tue, Apr 26, 2011 at 11:07 AM, Aurélien Aptel
<aurelien.aptel_AT_gmail.com> wrote:
> # the \$(cmd) in PS1 is probably bash-only
> # maybe PROMPT_COMMAND is more portable
> PS1="\$(dirbg)\u \w $"

It seems you need to enclose non-printing characters in \[\] on bash
and %{%} on zsh.
So for bash: PS1="\[\$(dirbg)\] \u \w $ "
For zsh you have to setopt promptsubst in order to substiture \$(cmd), so:
setopt promptsubst
PS1="%{\$(dirbg)%}%n %~ $ "

Voilà. It works on urxvt and xterm, for the rest YMMV.
Received on Tue Apr 26 2011 - 21:21:33 CEST

This archive was generated by hypermail 2.2.0 : Tue Apr 26 2011 - 21:24:02 CEST