terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Emojis not displayed properly

Open UsmanTariq2 opened this issue 1 year ago • 2 comments

Windows Terminal version

1.18.10301.0

Windows build number

10.0.22631.0

Other Software

No response

Steps to reproduce

Hello everyone , i am trying to input emojis in the terminal and have discovered many weird behaviours

Expected Behavior

When i input an emoji i expect it to be a single character rendered on the screen, however i have to press 2 back keys go back one emoji. This is weird.

Secondly, i am writing a c++ application where i have the following set:

std::setlocale(LC_CTYPE, ".UTF8");
SetConsoleOutputCP(CP_UTF8);
SetConsoleCP(CP_UTF8);

Is there a solution for this? Or is this in the list of todo things. Would be nice to see the correct emojis when entering input.

Actual Behavior

for unicode support. When copy paste a emoji in the terminal, it produces �� instead of the emoji. This is a rendering issue with the terminal as when i resize the terminal in PS mode(forgot to mention that) the emoji is displayed correctly. Secondly, if i go back 1 space(remember emojis are 2 characters) in between the ?? and add a space and then delete that space the emoji is correctly displayed.

Is there a solution for this? Or is this in the list of todo things. Would be nice to see the correct emojis when entering input.

UsmanTariq2 avatar Feb 07 '24 12:02 UsmanTariq2

Can you please try this in Windows Terminal Preview? You can find it in the Store or install the msixbundle here.

lhecker avatar Feb 07 '24 13:02 lhecker

Actually, just updating your regular Windows Terminal to 1.19 should also work. You can get the update directly here.

lhecker avatar Feb 07 '24 13:02 lhecker

Can you please try this in Windows Terminal Preview? You can find it in the Store or install the msixbundle here.

nope same issue with latest release as u said

UsmanTariq2 avatar Mar 19 '24 13:03 UsmanTariq2

Can you please post the C++ code here that you're using to test this issue? Edit: Also, you didn't say whether you're using Preview or not. Can you please tell me your exact version number as well, the one you can find in the About dialog?

lhecker avatar Mar 19 '24 14:03 lhecker

I did try the preview, the aformentioned issue is still present in it. I cannot post the c++ code because im not a developer on this

UsmanTariq2 avatar Apr 12 '24 18:04 UsmanTariq2

Here's my test code based on your original description:

#include <Windows.h>

#include <iostream>
#include <string>

int main() {
    std::setlocale(LC_CTYPE, ".UTF8");
    SetConsoleOutputCP(CP_UTF8);
    SetConsoleCP(CP_UTF8);

    std::string str;
    std::getline(std::cin, str);
    std::cout << str << std::endl;

    return 0;
}

and it doesn't reproduce in 1.19: image

I need to ask you to provide a repro, because otherwise I cannot help you solve this issue. 😕

lhecker avatar Apr 17 '24 14:04 lhecker

Ah ok will check

UsmanTariq2 avatar May 11 '24 22:05 UsmanTariq2