[konsole] [Bug 423814] New: Backspace and Delete keys only delete one Byte, not a whole character

Oussema Bouaneni bugzilla_noreply at kde.org
Thu Jul 2 22:54:30 BST 2020


https://bugs.kde.org/show_bug.cgi?id=423814

            Bug ID: 423814
           Summary: Backspace and Delete keys only delete one Byte, not a
                    whole character
           Product: konsole
           Version: 20.04.1
          Platform: Manjaro
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: konsole-devel at kde.org
          Reporter: the.neophytes.logs at gmail.com
  Target Milestone: ---

Created attachment 129854
  --> https://bugs.kde.org/attachment.cgi?id=129854&action=edit
Visual demonstration of the bug

Summary

Say you wanted to check for updates, you go into Konsole and type `sudo pacman
-Syu`.

>[oussema at glorious-manjaro ~]$ سعيخ حشؤةشى -ٍغع

Then you discover you typed the command in the wrong keyboard layout.
You switch the layout to US and press backspace until you're only left with the
bash prompt.

>[oussema at glorious-manjaro ~]$ 

Then you type it again, properly this time, and press enter.

>[oussema at glorious-manjaro ~]$ sudo pacman -Syu
>bash: $'\330\263\330\271\331\212\330\256': command not found

What happened?
You try the exact same thing except you don't release the backspace key once
you're only left with the bash prompt.
You discover that you can actually delete characters of the bash prompt.

>[oussema at gloriou

You go ahead and retype the command once the backspace key doesn't delete any
characters anymore.

>[oussema at gloriousudo pacman -Syu
>[sudo] password for oussema:

It works properly this time.
A little research online shows being able to delete the bash prompt is usually
due to unescaped color codes in the bash prompt.
But I can reproduce it even with a very simple bash prompt like 'Hello There:
'.




STEPS TO REPRODUCE
1. Open Konsole
2. Paste in any character that takes more than one byte.
An illustrative example is 🜁  (U+1F701) which is 4 bytes. ('\360\237\234\201'
in ANSI escape codes) 
3. Press backspace exactly once
4. Press Enter

OBSERVED RESULT
Only one byte is deleted, not the entire character. Bash think the remaining 3
bytes are a command.

>[oussema at glorious-manjaro ~]$ 
>bash: $'\360\237\234': command not found

You have to press backspace 4 times to delete the entire character at which
point you're deleting part of the bash prompt.



EXPECTED RESULT
The entire character is deleted with only one press of backspace.

>[oussema at glorious-manjaro ~]$ 
>[oussema at glorious-manjaro ~]$ 


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux Manjaro
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
This bug is also in qterminal if it helps. 
I did my best to convey the issue purely through text. But if you want a visual
demonstration, see the attached video.



This is my first time submitting a bug report here. I am aware that I probably
included way too much useless information and that I could have gone straight
to the point.
But I don't know what will be useful to you and what will just be a waste of
your time so bear with me.
Thank you in advance. Have a good day!

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list