From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20158 invoked by alias); 1 Jan 2015 23:03:01 -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: 19648 Received: (qmail 23970 invoked from network); 1 Jan 2015 23:02:59 -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=X+5rdgje c=1 sm=1 tr=0 a=jwg7e+C1pu9G5Tm+CahlKw==:117 a=jwg7e+C1pu9G5Tm+CahlKw==:17 a=Hpgzp-inWqAA:10 a=N659UExz7-8A:10 a=yLppadRo_atE6s9M3dQA:9 a=pILNOxqGKmIA:10 Message-id: <54A5D21F.1090701@eastlink.ca> Date: Thu, 01 Jan 2015 15:02:55 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: print color escapes References: <54A4DF80.7040206@eastlink.ca> <141231223506.ZM26289@torch.brasslantern.com> <54A59EE5.7000601@eastlink.ca> <150101132931.ZM27115@torch.brasslantern.com> In-reply-to: <150101132931.ZM27115@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 01/01/2015 01:29 PM, Bart Schaefer wrote: Excellent, the whole question boils down to this: > } local lc=$'\e[' > > > In that expression, the $'' form of quoting converts \e to ESC, which is > why the $'' form of quoting exists in the first place (and is different > from ordinary single quoting). $'' is to avoid having to do something > more expensive (fork + read output) such as lc="$(echo '\e[')". That is a POSIX quote? Good to see one in combat, I've only ever had them drawn to my attention once before. Book lernin' no substitute for seeing something in action. > The (V) flag converts ESC to ^[ because that's what most people are used > to seeing ("visible"). The (q) flag converts to $'\e' because that's > what people are used to writing (and because "eval ${(q)...}" needs it > in that format). Beautiful, these are conventions and practicalities not 'realities'. > The print and echo commands convert \e to ESC because > of historical practice. But terminal will always grab ESC 'hard' will it not? That is to say that no matter how you dress it up, the terminal always sees it verbatim. And I'd expect that that convention is now written in stone. > The bindkey command converts both ^[ and \e to > ESC for maximum flexibility in writing key bindings. All of this is > entirely independent of what the terminal does when it sees an ESC. > Crystal clear. Too bad there wasn't some way of upvoting an explanation like that were it to show up on Google eventually, cuz that's as good as it could be. Questions that were not even asked (but needed to be) were answered. BTW too bad in some fonts '' looks almost exactly like ".