zsh-users
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Lewis Butler <lbutler@covisp.net>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Prompts with emoji issues
Date: Tue, 19 May 2020 15:54:09 +0200	[thread overview]
Message-ID: <CAN=4vMrJ=_wBErQOnnSNiCKoN_uR4JVZQsBYHPhdASEM0cAHWA@mail.gmail.com> (raw)
In-Reply-To: <D65D526B-A2C9-4826-B3C8-51C90A4E87C1@covisp.net>

You need to fix typos in your prompt. Start with this:

  toon=$'\U1F479'
  PROMPT=$toon' %F{blue}%n@%m%f %F{green}%#%f '
  RPROMPT='%F{green}[%T]%f [%~]'

Note that I've replaced 👹 with $'\U1F479'. This is intentional. It's
meant to trigger an error if your locale is misconfigured. If you get
an error saying "zsh: character not in range", your locale isn't
UTF-8. You need to make it UTF-8.

This $toon is a wide unicode character, meaning that it takes 2
columns when printed. Some terminals have bugs that prevent them from
properly rendering such characters. You can check whether you terminal
can render $toon correctly with this command:

  print -r ${(l:${(m)#toon}:: :)}$'XYZ\n'$toon' ^-- must point to Y'

If the arrow points to Y, all is well. If it points to X or Z, either
your terminal is broken or unicode data used by zsh is incorrect. You
can employ a workaround to display $toon correctly nevertheless.

If the arrow points to X:

  toon=$'%{%2G\U1F479 %}'
  PROMPT=...
  RPROMPT=...

If the arrow points to Z:

  toon=$'%{%2G\U1F479%}'
  PROMPT=...
  RPROMPT=...

Roman.

  reply	other threads:[~2020-05-19 13:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  5:08 Lewis Butler
2020-05-13  6:52 ` Bart Schaefer
2020-05-13 16:47   ` Roman Perepelitsa
2020-05-13 21:14   ` Lewis Butler
2020-05-13 21:26     ` Lewis Butler
2020-05-14  3:54       ` Bart Schaefer
2020-05-14  9:50         ` Lewis Butler
2020-05-14 12:13           ` Lewis Butler
2020-05-14 17:55           ` Bart Schaefer
2020-05-14 18:18             ` Lewis Butler
2020-05-17 19:50               ` Lewis Butler
2020-05-17 20:39                 ` Bart Schaefer
2020-05-18  3:41                 ` Bart Schaefer
2020-05-18 12:23                 ` Lewis Butler
2020-05-19  0:26                   ` Bart Schaefer
2020-05-19 13:21                     ` Lewis Butler
2020-05-19 13:54                       ` Roman Perepelitsa [this message]
2020-05-19 22:05                         ` Lewis Butler
2020-05-19 23:20                           ` Daniel Shahaf
2020-05-20  5:16                           ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMrJ=_wBErQOnnSNiCKoN_uR4JVZQsBYHPhdASEM0cAHWA@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=lbutler@covisp.net \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).