From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4100 invoked by alias); 3 Dec 2014 04:28:12 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19481 Received: (qmail 13277 invoked from network); 3 Dec 2014 04:28:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=AduIQRnG c=1 sm=1 tr=0 a=wF+YgKUkZNOBI+JmS0mQZQ==:117 a=wF+YgKUkZNOBI+JmS0mQZQ==:17 a=G8GL833Es-AA:10 a=N659UExz7-8A:10 a=kd5tUqnIEz8yRaxBdmIA:9 a=pILNOxqGKmIA:10 Message-id: <547E9158.6050103@eastlink.ca> Date: Tue, 02 Dec 2014 20:28:08 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: triviality with prompts References: <547E568C.6070607@eastlink.ca> <141202190200.ZM31930@torch.brasslantern.com> In-reply-to: <141202190200.ZM31930@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 12/02/2014 07:02 PM, Bart Schaefer wrote: > On Dec 2, 4:17pm, Ray Andrews wrote: > } > } PS3 will permit that variable substitution even without > } " setopt prompt_subst ", whereas PS1 requires it. > > I think you've deluded yourself somehow. PS3 behaves just like all the > other prompts. A red herring there. I had this form, which seems not to need the option: PS3=$'\n '"$_red MAKE A SELECTION ... " ... and I changed it to this form, which does need it: PS3=$'\n $_red MAKE A SELECTION ... ' ... whereas in PS1 I had the (what look very much like) single quotes only version, which does need it, so one seemed to need it, and the other not. ... so the issue was quote voodoo, as usual. > > Once again you're confused about how quoting works. The variable isn't > inside single quotes at the time the prompt is expanded. In fact, in your > example $'...' is NOT the same as single quotes. God knows. If ' ... ' isn't single quotes then is sure has me fooled. One day it will all make sense. I know everything is different with prompt strings tho, it's a world unto itself where single quotes are not single quotes. > If you'd read a little further through the scrolls, you'd have seen you > need neither _red=$'%{\e[1;31m%}' nor prompt_subst: > > PS3=$'\n %F{red} MAKE A SELECTION ... %f' > PS1=$'\n%F{yellow}%l %F{red}%m %F{green}%n %F{blue}%d %F{magenta}%(3L.%L.)$ %f' There are so many scrolls! I'll get there. Anyway, I like my way better. Even knowing only a tiny bit about the prompt, it is astonishing how much love went into that.