Windows Terminal hangs when printing certain emoji #960

Open
opened 2026-01-30 22:12:31 +00:00 by claunia · 0 comments
Owner

Originally created by @ritchiehughes on GitHub (May 10, 2019).

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.18362.53]
    Windows Terminal: 0.1.1211.0 (this was a signed daily build of the appx)

  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)

Running this .NET Core app causes the Terminal to hang. This app uses Unicode.NET to generate emoji string encodings.

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

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

            foreach (var emoji in Emoji.All)
            {
                try
                {
                    Console.Write(emoji.ToString());
                }
                catch (Exception e)
                {
                    Console.Write($"[FAILED: {emoji.Name} - {e.Message}]");
                }
            }
        }
    }
}
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Unicode.net" Version="0.1.2" />
  </ItemGroup>
</Project>
  • What's wrong / what should be happening instead:

Once the loop gets to certain characters (with modifers?) the terminal hangs. Not always the same character. I'd expect problematic chars to be skipped or replaced with '??':

image

image

No repro in classic cmd.exe

Originally created by @ritchiehughes on GitHub (May 10, 2019). * Your Windows build number: (Type `ver` at a Windows Command Prompt) Microsoft Windows [Version 10.0.18362.53] Windows Terminal: 0.1.1211.0 (this was a signed daily build of the appx) * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) Running this .NET Core app causes the Terminal to hang. This app uses Unicode.NET to generate emoji string encodings. ```csharp using NeoSmart.Unicode; using System; using System.Text; namespace HangWindowsTerminal { class Program { static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; foreach (var emoji in Emoji.All) { try { Console.Write(emoji.ToString()); } catch (Exception e) { Console.Write($"[FAILED: {emoji.Name} - {e.Message}]"); } } } } } ``` ```xml <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.2</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Unicode.net" Version="0.1.2" /> </ItemGroup> </Project> ``` * What's wrong / what should be happening instead: Once the loop gets to certain characters (with modifers?) the terminal hangs. Not always the same character. I'd expect problematic chars to be skipped or replaced with '??': ![image](https://user-images.githubusercontent.com/18265132/57547709-4ecf5580-731c-11e9-8e2e-3e8947766662.png) ![image](https://user-images.githubusercontent.com/18265132/57547987-1c722800-731d-11e9-968f-9726a896200d.png) No repro in classic cmd.exe
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#960