3

Im accessing a remote computer using ssh and running a bash command to input symbols using standard input stream:

read test;echo $test

It's ok to input english letters and use backspace to delete them, then input other characters and iterate this steps any amount of times. But it becomes a disaster when I use other utf-8 symbols, like russian ones, which require 2 bytes instead of 1, as english ones do. E.g., I input:

абвгдежз

After that, I use backspace for 8 times, and input other symbols:

привет

And press Enter key. But instead of the result which would equal my last input, I get the following:

абвгпривет

Which means that 8 backspace deleted only 4 symbols.

I do use linux ubuntu 12.04. Tried different consoles: standard one, terminator; different types of backspace options (as ASCII-del or Ctrl+H); setting $LC_TYPE to ru_RU.UTF-8, but nothing works. There is no such a problem using local console. Thank you in advance.

update: I've also got a video of this issue, please watch it at youtube

2 Answers 2

2

You can work around this by running

stty iutf8

on the server each time you ssh there. Unfortunately this bug exists since 2005 year, watch though the debian forums for details. You may also want to add this line at the end of your .bashrc file.

0
3

You need to set LC_CTYPE to a UTF-8 locale, e.g. ru_RU.UTF-8 or en_US.UTF-8. You can list available locales using locale -a.

4
  • Thank you for your reply. I've already got $LC_TYPE set up as ru_RU.UTF-8 both on client and server side. Sadly, that does not resolve an issue.
    – Vsevolod Avramov
    Apr 24, 2013 at 7:34
  • @VsevolodAvramov Did you try to export that variable? And: When did you set it? If you set it in the shell, it might be too late...
    – glglgl
    Apr 24, 2013 at 7:40
  • @glglgl, I've got the following configuaration: 1) First lines of ~/.ssh/config are: Host * SendEnv LC_* 2) AcceptEnv directive is present in the server configuration at /etc/ssh/sshd_config 3) First lines of ~/.bashrc both on client- and serverside are export LC_CTYPE=ru_RU.utf8 4) locale -a shows ru_RU.utf8 in the list of available options for locale. Any more ideas? Thanks.
    – Vsevolod Avramov
    Apr 24, 2013 at 8:02
  • @glglgl I've also recorded a video which proves that variable LC_ENV is set up properly. Please watch it at youtube
    – Vsevolod Avramov
    Apr 24, 2013 at 8:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .