zsh-users
 help / color / mirror / code / Atom feed
* triviality with prompts
@ 2014-12-03  0:17 Ray Andrews
  2014-12-03  3:02 ` Bart Schaefer
  0 siblings, 1 reply; 17+ messages in thread
From: Ray Andrews @ 2014-12-03  0:17 UTC (permalink / raw)
  To: Zsh Users

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.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-12-07  0:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-03  0:17 triviality with prompts Ray Andrews
2014-12-03  3:02 ` Bart Schaefer
2014-12-03  4:28   ` Ray Andrews
2014-12-03  4:38     ` Lawrence Velázquez
2014-12-03 16:20       ` Ray Andrews
2014-12-03 16:43         ` Roman Neuhauser
2014-12-03 17:10           ` Ray Andrews
2014-12-03 17:39             ` Roman Neuhauser
2014-12-03 21:14             ` Bart Schaefer
2014-12-03 23:14               ` Ray Andrews
2014-12-04  5:06                 ` Bart Schaefer
2014-12-04 18:42                   ` Ray Andrews
2014-12-06 21:28                     ` Bart Schaefer
2014-12-07  0:37                       ` Ray Andrews
2014-12-03 21:16         ` Lawrence Velázquez
2014-12-03 21:22         ` Bart Schaefer
2014-12-03 23:40           ` Ray Andrews

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).