New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backspacing over emojis causes them to be half erased #1012
Comments
The same happens with double-width CJK characters. The problem is that the shell's line editing features are not fully aware of non-single-width glyphs and position the cursor just one position back in this case. |
I can backspace fine over a double width such as |
Ah right, this didn't work yet not too long ago. So maybe the shell uses out-of-date width information (a.k.a. locale). |
The files referenced by this?
|
For me, bash and mintty behave alike for characters 啕, ✅, 😀. |
3.1.8 啕 erases fine |
For the records: |
Is there a table somewhere with all the correct character widths? Mintty has a multitude of issues with character width, but there's no point reporting them without knowing whether mintty is getting it wrong, the font is getting it wrong, or whether it's like the wild west and everyone does whatever they want. |
@mintty builds the project using tables from the latest Unicode releases which include recommended monospace character spacing for Asian and other glyphs, also takes into account text direction and other info, depending on locale and font settings. |
By default, mintty applies character width strictly following the "locale" set before starting mintty. Thus character width properties are determined by the system, not mintty. There is no multitude of mintty issues in this mode of operation, although the locale mechanism has its own issues, generic to all terminals. There is also no font dependency in default mode of operation. |
I had the impression indicwide.t is used, among other things, to determine width? |
Only if enabled by the respective escape sequence, see https://github.com/mintty/mintty/wiki/CtrlSeqs#wide-characters. |
Interesting, too bad it's not supported by xterm as well. Any hints as to how to pull the "locale" information for characters? |
@mintty This backspace bug seems to be fixed, except now emojis are double width but count as single width when cursoring over them to the right, so you have to right arrow over them twice to get to the previous letter. Also if you just have an emoji then the same applies to left arrow too. If you type a character mid-emoji you end up with a weird prompt: Also, the cursor flashes if you're over an emoji in the terminal. Should I open two new bugs for these, or keep it all on this? (My emoji is noto) |
To assess this issue and whether it's a bug at all (see comments above), please describe your environment: |
$ uname -a $ echo $BASH_VERSION Any emoji causes the above behaviour |
Maybe we should also check your .inputrc and your locale, also your libreadline version. |
I wasn't sure about the precise key sequence that you're entering. This shows that exact descriptions are highly preferable over images or videos. When logging actual character output (e.g. mintty -l .log), final output is: |
Setting up Noto emoji using
Emojis=noto
in the config file (it doesn't allow me to select in the UI, it only ever shows None which might be another bug).When entering emoji and then backspacing it only deletes half the emoji:
The text was updated successfully, but these errors were encountered: