Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
triviality with prompts
- X-seq: zsh-users 19477
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: triviality with prompts
- Date: Tue, 02 Dec 2014 16:17:16 -0800
- 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
Reading in the scrolls, I find this:
setopt prompt_subst
... which permits this:
_red=$'%{\e[1;31m%}'
_grn=$'%{\e[1;32m%}'
_yel=$'%{\e[1;33m%}'
_blu=$'%{\e[1;34m%}'
_mag=$'%{\e[1;35m%}'
PS3=$'\n $_red MAKE A SELECTION ... '
PS1=$'\n$_yel%l $_red%m $_grn%n $_blu%d $_mag%(3L.%L.)$ %{\e[0m%}'
... which sure makes things more readable. However I note that
PS3 will permit that variable substitution even without
" setopt prompt_subst ", whereas PS1 requires it. Is that an
anomaly or necessary? Could that setopt be on by default?
Interesting that the variable expands even tho inside single
quotes, not that I'm complaining.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author