1

For pasting text, in urxvt/rxvt-unicode one can use middle button to paste PRIMARY selection.

I can do such Mouse-Middle-Click paste in my local urxvt terminal and even a remote server, in Chinese/utf8 strings. EG if I run date under LANG=zh_CN.utf8 environment and I'll get:

$ date 2023年 03月 18日 星期六 15:01:11 EDT 

I can then mouse select the Chinese/utf8 string 星期六 and Mouse-Middle-Click paste into my urxvt terminal (after my echo), like:

$ echo 星期六 星期六 

in my local urxvt terminal and even a remote server. However, if I ssh into my other local machines, or my Oracle cloud then try the same approach, instead of echo 星期六 showing up on my command line, I'm getting:

enter image description here

if I select the whole echo 星期六, and past into the remote session, then it'll work, for either my local machines or my Oracle cloud server.

Here is the screen-cast to illustrate it:

enter image description here

EG

  • the Chinese/utf8 strings cannot be pasted into my remote urxvt terminal normally.
  • however if there are some leading normal ascii characters before the Chinese/utf8 string, then the whole thing can be pasted in normally.

All my environment are configured the same across all of them, So I'm thinking there must be something odd with my configuration which works only locally but not remotely.

(My local machines and Oracle cloud server displays Chinese/utf8 strings/filenames just fine though.)

UPDATE: more debug info

$ locale LANG=zh_CN.utf8 LANGUAGE= LC_CTYPE="zh_CN.utf8" LC_NUMERIC="zh_CN.utf8" LC_TIME="zh_CN.utf8" LC_COLLATE="zh_CN.utf8" LC_MONETARY="zh_CN.utf8" LC_MESSAGES="zh_CN.utf8" LC_PAPER="zh_CN.utf8" LC_NAME="zh_CN.utf8" LC_ADDRESS="zh_CN.utf8" LC_TELEPHONE="zh_CN.utf8" LC_MEASUREMENT="zh_CN.utf8" LC_IDENTIFICATION="zh_CN.utf8" LC_ALL= $ locale charmap UTF-8 $ grep '^set.*meta' ~/.inputrc set meta-flag on set input-meta On set output-meta On 

How to fix it?

3
  • Is it only the shell that's misbehaving, or also other apps (e.g. text editors)? Check the output of locale, it should look reasonable. Check the output of locale charmap, it should say UTF-8. Check your shell's config. Is your shell bash? If so, .inputrc should contain things like set input-meta on and set output-meta on. Commented Mar 25, 2023 at 11:15
  • I've updated my OP to include answers to all your questions, @egmont, thanks. Basically all are as expected. And, BINGO! it is only the shell that's misbehaving (yes my shell is bash), using a text editor, pasting Chinese/utf8 strings works just fine! Commented Mar 25, 2023 at 19:07
  • Okay so it's obviuosly a bash thing, then, but I have no idea what exactly. Maybe try comparing /etc/inputrc and .inputrc on the two systems, looking for other differences. Also check bash's version, maybe the remote one is an ancient version that was buggy? But I'm just shooting in the dark. Commented Mar 25, 2023 at 19:22

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.