Skip to content
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

Additional space inserted at char 100 when a single-width emoji preceeds it #674

Closed
ritchiehughes opened this issue May 10, 2019 · 1 comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Milestone

Comments

@ritchiehughes
Copy link
Member

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.18362.53]
    Windows Terminal appx download from GitHub: 0.1.1211.0

  • What you're doing and what's happening:

Ran a simple .NET Core 2.1 application (below) that outputs various UTF-8 emojis. Bug is that when a single-width (?) emoji is printed ("Computer Mouse"), the output includes an extra 'space' later on at character position 100. No issue when it's double-width ("Computer Disk"), :

image

  • What's wrong / what should be happening instead:

Text following the single-width emoji should not be modified or respaced.

Code sample (using Unicode.NET package from NuGet)

using NeoSmart.Unicode;
using System;
using System.Text;

namespace DetectWindowsTerminal
{
    class Program
    {
        static void Main(string[] args)
        {
            string a  = "ABCDEFGHIJKLMNOPQRSTUVWZYZ ";
            Console.OutputEncoding = Encoding.UTF8;

            Console.WriteLine($"123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_");
            Console.WriteLine($"--------10--------20--------30--------40--------50--------60--------70--------80--------90-------100");
            Console.WriteLine($"{a}{a}{a}[{Emoji.ComputerMouse.ToString()}]{a}{a}");
            Console.WriteLine($"{a}{a}{a}[{Emoji.ComputerDisk.ToString()}]{a}{a}");
            Console.ReadLine();
        }
    }
}
@adiviness adiviness added the Issue-Bug It either shouldn't be doing this or needs an investigation. label May 10, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. and removed Mass-Chaos labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@zadjii-msft zadjii-msft added this to the 20H1 milestone Jun 11, 2019
@DHowett-MSFT
Copy link
Contributor

This is a couple issues. One is probably #2066 (disagreement between conpty and windows terminal about glyph width). The other is #1472 -- the Computer Mouse emoji is actually two codepoints that combine, and we, being simple and cell-based, don't understand these two codepoints to be a single grapheme cluster.

@DHowett-MSFT DHowett-MSFT added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Aug 28, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

5 participants