From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7ee335da for ; Thu, 12 Dec 2019 00:29:47 +0000 (UTC) Received: (qmail 295 invoked by alias); 12 Dec 2019 00:29:38 -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: List-Unsubscribe: X-Seq: 24519 Received: (qmail 19267 invoked by uid 1010); 12 Dec 2019 00:29:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-lj1-f181.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25656. spamassassin: 3.4.2. Clear:RC:0(209.85.208.181):SA:0(-1.9/5.0):. Processed in 4.8886 secs); 12 Dec 2019 00:29:38 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.208.181 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=mHcPNR8BIAesLBrH/BQXuX56spHeCZVSUMlk9os6+GU=; b=qStIqkf0doi2px7wZY4qb/GQYsqFnu98eWfJklJ2JxAdQRK9JO1DCrR77pk5d1Qtsi oXcIBYUq4KTnbmRBBm9Jhy3IbkyKo8WZnlohP+pUJY6mu6hkhAYAofz6/FoRbro+h2Hs RS412RSrcZxWFzXDRLA0hhr/VAVLnmVsM14ks0gIlsPeB3ZR6CzQO1Dacs3NGz5Tc4kQ +sGb8e+SVGB59IuCOYEtTsuVt6AkyE7LAvbHFIw2mTpTVTMStXJcn1G8tQxuCZGniusA azNBoYgkcPe0QPkX898+rHA9w324al8tJBQdzUjyGi5F8mz5PHiFR3uFs4nY7LI4qaVP 8mFA== X-Gm-Message-State: APjAAAXqwNPraRv4XJmELtqJgOXhhGBlabguSsb0a3MCQQeCyBJQaRUS /9DENsys8qXB6g2yLCukLTtbL5kJVFWB6J0rolmDBqTHtNrWWg== X-Google-Smtp-Source: APXvYqzB07C4w0qHe6PlLTyXGL2NrgRMz4AePdTT+xialUGaPavOxEbLbUaWqEbBej8bbYiL49PXCN3rU1xKW3YhY/E= X-Received: by 2002:a2e:90c8:: with SMTP id o8mr4115558ljg.4.1576110538269; Wed, 11 Dec 2019 16:28:58 -0800 (PST) MIME-Version: 1.0 References: <6AC48A70-FD29-4E88-9BD1-B189922E2793@covisp.net> In-Reply-To: <6AC48A70-FD29-4E88-9BD1-B189922E2793@covisp.net> From: Bart Schaefer Date: Wed, 11 Dec 2019 16:28:46 -0800 Message-ID: Subject: Re: Niggling little problem with a theme To: Lewis Butler Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 11, 2019 at 1:37 PM Lewis Butler wrote: > > PROMPT=3D$'%{$fg[magenta]%}$(toon)%{$reset_color%} %{$fg_bold[green]%}%n@= %m %{$fg_bold[blue]%}%#%{$reset_color%} ' > RPROMPT=3D$'%{$fg[blue]%}[%T] %{$reset_color%}%{$fg[white]%}[%~]%{$reset_= color%} =E2=80=98 > > Works fine in nearly all cases, but occasionally when I am trying to edit= a command line, the space after the prompt disappears and it makes it quit= e difficult to edit as the command that appears on the screen is shifted on= e character off. You need to look at the "glitch" feature of prompts: %G Within a %{...%} sequence, include a `glitch': that is, ass= ume that a single character width will be output. This is use= ful when outputting characters that otherwise cannot be correc= tly handled by the shell, such as the alternate character set= on some terminals. The characters in question can be inclu= ded within a %{...%} sequence together with the appropriate num= ber of %G sequences to indicate the correct width. An inte= ger between the `%' and `G' indicates a character width other t= han one. Hence %{seq%2G%} outputs seq and assumes it takes up = the width of two standard characters. So you probably want either %{$(toon)%2G%} in your PROMPT assignment (indicating that the output of $(toon) takes up exactly two character widths), or to modify the "toon" function to output the %{...%} along with the correct number of "glitches" for the emoji it prints. The latter is likely more easily modifiable.