Bug 1270248 - backspace in interactive session does not delete multi-byte Unicode characters correctly
backspace in interactive session does not delete multi-byte Unicode character...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: openssh (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jakub Jelen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-09 08:05 EDT by Petr Spacek
Modified: 2015-12-22 17:00 EST (History)
6 users (show)

See Also:
Fixed In Version: openssh-7.1p1-6.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-22 17:00:09 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
OpenSSH Project 2477 None None None Never

  None (edit)
Description Petr Spacek 2015-10-09 08:05:14 EDT
Description of problem:
Backspace in interactive session does not delete multi-byte Unicode characters completely. To delete a character complerely, user has to press backspace as many times as number of bytes used to represent the Unicode character. See the example below.

Version-Release number of selected component (if applicable):
openssh-7.1p1-3.fc23.x86_64
openssh-clients-7.1p1-3.fc23.x86_64
openssh-server-7.1p1-3.fc23.x86_64

How reproducible:
100 %

Steps to Reproduce:
1. SSH into a F23 machine.
2. $ cat > test
3. Use this as a input for cat command:
Á<press backspace once><press CTRL+D><press CTRL+D>
4. $ hexdump test

Actual results:
0000000 00c3                                   
0000001

Expected results:
The file "test" should be empty.

Additional info:
"Á" is represented by two bytes.

This does not happen when SSH is not in use. If you try the same sequence of keys locally the file will be actually empty. This is PITA when you work with Unicode texts over SSH, because you never know what was deleted and it can leave incomplete Unicode sequences in files you edit over SSH.
Comment 1 Jakub Jelen 2015-10-09 09:25:04 EDT
Hi Petr.
Thank you for a report.

It looks this behaviour is the same even with older openssh versions since they probably don't count with multibyte characters.

I was able to reproduce your test case. I will file upstream bug, because it can be confusing and it should be solved upstream.

Workaround for this case is to set remote tty to handle utf8 correctly (successfully tested)
$ stty iutf8

Solution is creation of remote tty's with these flags (IUTF8, which is unfortunately not POSIX so we will have to think about portability in upstream), according to article (last paragraph about tty) [1].

[1] https://www.cl.cam.ac.uk/~mgk25/unicode.html#mod
Comment 2 Fedora Update System 2015-12-18 09:41:51 EST
openssh-7.1p1-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-8e6294b5c2
Comment 3 Fedora Update System 2015-12-19 15:00:37 EST
openssh-7.1p1-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update openssh'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-8e6294b5c2
Comment 4 Fedora Update System 2015-12-22 17:00:02 EST
openssh-7.1p1-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

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