Multi-byte chars not erased correctly by backspace in Git Bash #19805

Closed
opened 2026-01-31 06:54:05 +00:00 by claunia · 3 comments
Owner

Originally created by @ap-axentia on GitHub (May 4, 2023).

Windows Terminal version

1.16.10262.0

Windows build number

10.0.22621.1555

Other Software

Git Bash (Git for Windows), git version 2.40.1.windows.1
Git Bash in Windows Terminal installed with Git for Windows installer checkbox option.

Steps to reproduce

Install Git for Windows, check the box to add it to Windows Terminal.
Open Windows Terminal Git Bash.
Type a character that use more than one byte, eg. £ or ö.
Use backspace to erase the char.

(I am unsure if the issue lies with Windows Terminal or Git for Windows, but I cannot reproduce the same bug in git-bash.exe so that is why I opened the issue here.)

Expected Behavior

The char is erased fully, so that no trace of it is left neither visually nor in the background.

Actual Behavior

The char is erased visually, but something seems to still be left in the background. When pressing backspace again a char of the prompt is removed. Or, if not pressing backspace again, when pressing enter, the response bash: □: command not found is given, where one would expect no response.

image

Originally created by @ap-axentia on GitHub (May 4, 2023). ### Windows Terminal version 1.16.10262.0 ### Windows build number 10.0.22621.1555 ### Other Software Git Bash (Git for Windows), git version 2.40.1.windows.1 Git Bash in Windows Terminal installed with Git for Windows installer checkbox option. ### Steps to reproduce Install Git for Windows, check the box to add it to Windows Terminal. Open Windows Terminal Git Bash. Type a character that use more than one byte, eg. `£` or `ö`. Use backspace to erase the char. (I am unsure if the issue lies with Windows Terminal or Git for Windows, but I cannot reproduce the same bug in git-bash.exe so that is why I opened the issue here.) ### Expected Behavior The char is erased fully, so that no trace of it is left neither visually nor in the background. ### Actual Behavior The char is erased visually, but something seems to still be left in the background. When pressing backspace again a char of the prompt is removed. Or, if not pressing backspace again, when pressing enter, the response `bash: □: command not found` is given, where one would expect no response. ![image](https://user-images.githubusercontent.com/104353026/236152133-78309703-2d17-4432-8591-5130aaad605e.png)
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 06:54:05 +00:00
Author
Owner

@keith555 commented on GitHub (May 4, 2023):

Sounds similar to #9205

@keith555 commented on GitHub (May 4, 2023): Sounds similar to #9205
Author
Owner

@ap-axentia commented on GitHub (May 4, 2023):

Yes, it sounded very similar to #9205. I tried some more, following the reproduction steps in that issue and in my issue, and I realized that I might have had a messed up git installation, or rather a manual Git Bash addition in Terminal that I confused myself with. So I cannot actually reproduce the problem again. (I had som other issues with git and delta/highlighting therefore I did a lot of experiments.)

So I am actually closing this now, since I believe that a correctly installed and added Git Bash in Windows Terminal actually works. And any remaining issues will be covered by #9205.

@ap-axentia commented on GitHub (May 4, 2023): Yes, it sounded very similar to #9205. I tried some more, following the reproduction steps in that issue and in my issue, and I realized that I might have had a messed up git installation, or rather a manual Git Bash addition in Terminal that I confused myself with. So I cannot actually reproduce the problem again. (I had som other issues with git and delta/highlighting therefore I did a lot of experiments.) So I am actually closing this now, since I believe that a correctly installed and added Git Bash in Windows Terminal actually works. And any remaining issues will be covered by #9205.
Author
Owner

@dktapps commented on GitHub (Oct 20, 2023):

I've had issues with my Git commit messages containing random corrupted characters for almost a year. Turns out it's because " and £ are right next to each other on the British keyboard layout, and backspacing £ leaves a c2 byte, which turns into  when interpreted by bash.

Thank you for writing this issue, you saved me months of misery.

@dktapps commented on GitHub (Oct 20, 2023): I've had issues with my Git commit messages containing random corrupted characters for almost a year. Turns out it's because `"` and `£` are right next to each other on the British keyboard layout, and backspacing `£` leaves a `c2` byte, which turns into `Â` when interpreted by bash. Thank you for writing this issue, you saved me months of misery.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19805