Emoji in Ubuntu shell are not deleted correctly #8896

Closed
opened 2026-01-31 01:40:46 +00:00 by claunia · 5 comments
Owner

Originally created by @ivanjonas on GitHub (Jun 8, 2020).

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.

Originally created by @ivanjonas on GitHub (Jun 8, 2020). # Environment ```none Windows build number: 10.0.18362.0 Windows Terminal version (if applicable): 1.0.1401.0 Any other software? ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> 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](https://user-images.githubusercontent.com/4935079/83986113-a833fa80-a909-11ea-9d87-93310ec476be.png) Deleting double-width emoji will move the cursor back only one space, and the displayed command is be the command that will be executed.
Author
Owner

@guilhermetod commented on GitHub (Jun 18, 2020):

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?

@guilhermetod commented on GitHub (Jun 18, 2020): 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?
Author
Owner

@zadjii-msft commented on GitHub (Jun 18, 2020):

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

@zadjii-msft commented on GitHub (Jun 18, 2020): Hey lemme real quick cross link this with discussion over in #6555, which is seeing some similar disagreement in character width
Author
Owner

@ivanjonas commented on GitHub (Jun 18, 2020):

@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").

@ivanjonas commented on GitHub (Jun 18, 2020): @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").
Author
Owner

@DHowett commented on GitHub (Jun 19, 2020):

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

@DHowett commented on GitHub (Jun 19, 2020): It looks like we root-caused this in /dup #6555, so I'm gonna close this one out. Thanks everyone for reporting!
Author
Owner

@ghost commented on GitHub (Jun 19, 2020):

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!

@ghost commented on GitHub (Jun 19, 2020): 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8896