zsh-workers
 help / color / Atom feed
From: Nathan Sidwell <nathan@acm.org>
To: zsh-workers@zsh.org
Subject: unicode in prompt breaks command search
Date: Thu, 16 Jan 2020 16:43:37 -0500
Message-ID: <bac9b085-23b6-1e58-bc7d-715def0a22fe@acm.org> (raw)

For reasons, I put a multibyte unicode char in $PROMPT, this ends up 
messing with zsh's idea of the current column, as it doesn't understand 
the display width of $PROMPT.

For example reverse search, here's an example using <f0><9f><a1><85>

set PROMPT="🡅"

press C-r, see cursor gets indented another 3 spaces -- we're now at 
column 5, which would be correct if each byte of $PROMPT was a separate 
display char.

A slightly modified example is to enter some text before pressing C-r, 
then the first 3 chars get retained on the display (but not the input 
buffer at least).

Is this supposed to work?

This is ZSH 5.2 on a fedora 30 system, and an XFCE terminal.  Let me 
know if you need more info (I'm not on the list).

nathan
-- 
Nathan Sidwell


             reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 21:43 Nathan Sidwell [this message]
2020-01-17  1:25 ` dana
2020-01-17  8:23   ` Roman Perepelitsa
2020-01-17 12:05   ` Nathan Sidwell

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=bac9b085-23b6-1e58-bc7d-715def0a22fe@acm.org \
    --to=nathan@acm.org \
    --cc=zsh-workers@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

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git