Terminal: Emoji in Ubuntu shell are not deleted correctly

Created on 8 Jun 2020  Â·  5Comments  Â·  Source: microsoft/terminal

Environment

Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 1.0.1401.0

Any other software?

Steps to reproduce

  1. Open an Ubuntu/bash window
  2. Note the position of the cursor.
  3. Type the word "git"
  4. Open the Windows emoji picker with Win + period and choose an emoji. For example, the "smiling face with smiling eyes" emoji (😊) or any other emoji that isn't part of the original windows black-and-white emoji set. For contrast, the recycle (♻) emoji does not show this problem because it's part of that set.
  5. Press backspace once to delete the emoji. Notice that the emoji is still visible but the cursor is in the middle of it.
  6. Press backspace again to "finish" deleting the emoji. The original text "git" will still be visible.
  7. Press Enter.

Expected behavior

The git program runs outputting information about subcommands.
If I delete an emoji character that takes up two blocks of space, I expect the cursor to go backward two spaces, and I expect that pressing Enter will execute the command that is displayed.

Actual behavior

The command prompt complains "gi: command not found", even though the line above still says "git"

image

Deleting double-width emoji will move the cursor back only one space, and the displayed command is be the command that will be executed.

Area-Output Issue-Bug Priority-3 Product-Conhost Resolution-Duplicate

All 5 comments

I see you're using a PowerLine theme. Can you please share the name of it and for which shell? I suggest that you look into the theme's file (e.g. ~/.oh-my-zsh/agnoster.zsh-theme) and see if it's using "literal" emojis (😊) or encoded (\U1F60A or a plugin like emoji[smiling_face_with_smiling_eyes]).

I built a custom theme and had this issue. The problem was in the PowerLine part. It managed to render correctly, but it was badlly encoded and some characters would break it. Not an issue with the terminal.

Edit: For what I see it's relly bash with oh-my-bash, right?

Hey lemme real quick cross link this with discussion over in #6555, which is seeing some similar disagreement in character width

@guilhermetod Heh, you're right, it seems the Windows Terminal came with a powerline out of the box, and it DOES have some issues... but that's a red herring :) I only intended to highlight the difference between the command itself in line 1 ("git") and the interpreted command in line 2 ("gi").

It looks like we root-caused this in /dup #6555, so I'm gonna close this one out. Thanks everyone for reporting!

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CobusKruger picture CobusKruger  Â·  60Comments

cinnamon-msft picture cinnamon-msft  Â·  62Comments

NOFUNEVER picture NOFUNEVER  Â·  106Comments

privacyguy123 picture privacyguy123  Â·  131Comments

Ronkiro picture Ronkiro  Â·  65Comments