question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

emojis inside PS1 offset cursor by 1

See original GitHub issue
  • OS version and name: High Sierra 10.13.2 (17C88)
  • Hyper.app version: Hyper 1.4.8 (stable)

Issue

If I include an emoji inside PS1 my terminal cursor has an offset of 1.

export PS1="\w " # works export PS1="\w 🐱" # issue

Any idea on what to do?

I took a screenshot to show the issue: https://imgur.com/a/Z2yxV

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
bittttttencommented, Oct 7, 2020

I am still hitting this isse in Hyper 3.0.2 on stable and on canary.

PROMPT='%F{yellow}%/ 👻 %f'

Notice the space after the ghost. It appears in hyper like so:

Screenshot 2020-10-07 at 12 42 51

You can see the ghost is taking up two character spaces. If I replace the ghost with a letter, like A you’ll get:

Screenshot 2020-10-07 at 12 43 35

To compare, this is what it looks like in my IDE. Ghost+space+“clear” against “A”+space+“clear”.

Screenshot 2020-10-07 at 12 49 12

3reactions
LabhanshAgrawalcommented, Jul 6, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

emojis inside PS1 offset cursor by 1 · Issue #2587 - GitHub
This is with an emoji and a space. The emoji seems to take up 2 columns and the cursor does not respects that,...
Read more >
How can I properly use two-character-width emoji in my bash ...
I want to use an American flag emoji in my bash prompt (i.e. PS1 environment variable). However, the American flag emoji causes the...
Read more >
reverse-i-search generates an offset when prompt starts with an ...
What happened: the cursor is on the "2" and the whole command is offset by 2 characters you can move ... my UTF8...
Read more >
Custom bash prompt - cursor positioning issue [duplicate]
On my CentOS VM I made a custom script for my bash prompt in ... However If I type a long command and...
Read more >
KcT - River Thames Conditions - Environment Agency - GOV.UK
Party supplies cheap wholesale, 1 meter 70 in feet and inches. ... Monte carlo france casino, Northwold primary school, Pc monitor screen offset....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found