Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

triviality with prompts



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