Red Hat Bugzilla – Bug 1270248
backspace in interactive session does not delete multi-byte Unicode characters correctly
Last modified: 2015-12-22 17:00:09 EST
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):
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
The file "test" should be empty.
"Á" 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.
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) .
openssh-7.1p1-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-8e6294b5c2
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
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.