GNU Screen doesn’t echo unicode characters correct

When I do this in my terminal:

echo -e "xF0x9fx8dxba"

I get a cool beer mug in my terminal: 🍺

However, when I start screen, and try the same, I’m getting a �. How do I get the nice beer mug?

This is my .screenrc:

nethack on
startup_message off
defscrollback 3000
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %c"
termcapinfo xterm '<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="21434261">[email protected]</a>:<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="13716053">[email protected]</a>'
ignorecase on
maptimeout 0
vbell off
defutf8 on
defencoding utf8

Also running screen with the -U option doesn’t help.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

It’s a apparently a known bug: No characters beyond the BMP are displayed, as screen apparently only has a two byte buffer for characters.

(It works in tmux).

Method 2

It’s known issue for old screen.
It is fixed as of v4.2.0

Update screen to latest version:

sudo apt upgrade screen

Other commands:

  • see available screen versions: apt list -a screen
  • install exact version: sudo apt install screen=4.3.1-2build1

Method 3

For me emojis started work in GNU Screen (in local and remote server screens) after fixing locale. On my Mac I added to

~/.bash_profile

those lines:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x