Bug 978080 - ssh seems to mishandle unicode characters > 1b when editing CLI
ssh seems to mishandle unicode characters > 1b when editing CLI
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openssh (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity low
: beta
: 6.5
Assigned To: Petr Lautrbach
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-25 20:05 EDT by David Jaša
Modified: 2013-07-19 11:23 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-12 06:58:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
env (2.94 KB, text/plain)
2013-07-19 09:10 EDT, David Jaša
no flags Details

  None (edit)
Description David Jaša 2013-06-25 20:05:21 EDT
Description of problem:
when connected with RHEL 6 ssh to any host (localhost, remote F19 openssh/bash, remote OpenWRT dropbear/ash), terminal misbehaves when editing CLIs that contain 2 byte unicode characters - when the cursor is to the right of such character and you move left, the cursor gets in the middle of the character instead of left to it. In some remote systems (F19 with tmux), even some whitespace is inserted to the right of the characters...
Given that all the remote systems misbehave the same, local (X) terminal works ok, I suspect ssh client as the culprit
The system locale is cs_CZ.UTF-8

Version-Release number of selected component (if applicable):
openssh-5.3p1-84.1.el6.x86_64
bash-4.1.2-14.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. connect with ssh to some host
2. paste this command to the terminal, hit enter:
echo -n '' | hexdump
3. hit up arrow
4. paste 'š' character inside the apostrophes, hit enter
5. hit up arrow
6. move left to get the cursor right right of 'š' character, ie 'š|' (pipe sign is placeholder for the cursor)
7. move one more character to the right
8. paste 'š' character
9. hit enter again

Actual results:
4. you can see output like this:
0000000 a1c5                                   
0000002
or:
0000000 c5a1                                   
000000
depending on your architecture
8. you can notice that something goes wrong with the CLI
you see output like:
0000000 c5c5 a1a1                              
0000004
meaning that the second 'š' got pasted right into middle of first 'š'


Expected results:
4. the same
8. nothing gets wrong when editing cli - i.e.:
0000000 a1c5 a1c5                              
0000004
or:
0000000 c5a1 c5a1                              
0000004


Additional info:
when you hop from the beginning to the end and vice versa in plain shell (no tmux), the PS1 prompt gets eaten with each hop to the left
Comment 1 Petr Lautrbach 2013-06-27 09:25:13 EDT
I'm not able to reproduce your issue. What kind of xterminal do you use? Is it on rhel-6 or are you connected to rhel-6 via ssh? Are you on a physical console? Or is it a virtual and do you use vnc? spice?
Comment 2 David Jaša 2013-06-27 09:45:01 EDT
gnome-terminal on RHEL6.
Comment 3 Petr Lautrbach 2013-06-27 14:11:40 EDT
still can't reproduce. Random idea: how does your prompt PS1 or so looks like?
Comment 4 Petr Lautrbach 2013-07-12 06:58:35 EDT
If you can provide more information how to reproduce this issue, please attach them and reopen this bug.
Comment 5 David Jaša 2013-07-19 09:10:56 EDT
Created attachment 775801 [details]
env
Comment 6 David Jaša 2013-07-19 11:23:22 EDT
The observed behaviour was caused by setting LC_ALL to C, so there is no bug on ssh part indeed, just bogus configuration.

Note You need to log in before you can comment on or make changes to this bug.