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

Fail to show emojis #15697

Closed
littlewhitecloud opened this issue Jul 12, 2023 · 22 comments
Closed

Fail to show emojis #15697

littlewhitecloud opened this issue Jul 12, 2023 · 22 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Powershell Issues in the modern command interpreter, Powershell.exe. Resolution-External For issues that are outside this codebase

Comments

@littlewhitecloud
Copy link

littlewhitecloud commented Jul 12, 2023

Windows Terminal version

1.18.1462.0

Windows build number

10.0.19045.3031

Other Software

No response

Steps to reproduce

Press "Win" + "."
And press any of the emoji.
Then it will show a "?"

Expected Behavior

image

Actual Behavior

image

@littlewhitecloud littlewhitecloud added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 12, 2023
@zadjii-msft
Copy link
Member

I'm pretty sure that PsReadline should generally support emoji input... and I can't seem to repro this. Is there a particular emoji that this doesn't work with? Did this work in earlier Terminal versions/? Which version of PowerShell (& psreadline) are you using? Is there anything else about your shell config we should know?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 12, 2023
@littlewhitecloud
Copy link
Author

I'm pretty sure that PsReadline should generally support emoji input... and I can't seem to repro this. Is there a particular emoji that this doesn't work with? Did this work in earlier Terminal versions/? Which version of PowerShell (& psreadline) are you using? Is there anything else about your shell config we should know?

I tried a lot of emoji and they all failed.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 12, 2023
@littlewhitecloud
Copy link
Author

image
So how do developers get this screenshot in the settings?

@littlewhitecloud
Copy link
Author

image
Why this successed?

@237dmitry
Copy link

This works for me:

Screenshot 2023-07-13 093208

@zadjii-msft
Copy link
Member

Why this successed

Well, to be totally honest, outputting emoji to the console/terminal mostly works at this point. The fact that it didn't in your initial screenshot is certainly very confusing. I'd suspect that it has something to do with the way PowerShell / PsReadline (which is the process that's handling the input) is configured on your machine. Hence the rest of my questions:

  • Did this work in earlier Terminal versions/?
  • Which version of PowerShell (& psreadline) are you using?
  • Is there anything else about your shell config we should know?

Maybe there's something about the codepage that psreadline is in? @SteveL-MSFT any ideas?

@littlewhitecloud
Copy link
Author

settings.json

{
    "$help": "https://aka.ms/terminal-documentation",
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "actions": 
    [
        {
            "command": 
            {
                "action": "copy",
                "singleLine": false
            },
            "keys": "ctrl+c"
        },
        {
            "command": "paste",
            "keys": "ctrl+v"
        },
        {
            "command": "find",
            "keys": "ctrl+shift+f"
        },
        {
            "command": 
            {
                "action": "splitPane",
                "split": "auto",
                "splitMode": "duplicate"
            },
            "keys": "alt+shift+d"
        }
    ],
    "centerOnLaunch": true,
    "copyFormatting": "none",
    "copyOnSelect": false,
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "newTabMenu": 
    [
        {
            "type": "remainingProfiles"
        }
    ],
    "profiles": 
    {
        "defaults": 
        {
            "antialiasingMode": "cleartype",
            "backgroundImage": "desktopWallpaper",
            "backgroundImageOpacity": 0.45,
            "font": 
            {
                "size": 10.0
            },
            "intenseTextStyle": "bright",
            "opacity": 50,
            "padding": "10",
            "suppressApplicationTitle": false,
            "useAcrylic": true,
            "useAtlasEngine": true
        },
        "list": 
        [
            {
                "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
                "font": 
                {
                    "face": "Cascadia Mono"
                },
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "hidden": false,
                "name": "Windows PowerShell"
            },
            {
                "commandline": "%SystemRoot%\\System32\\cmd.exe",
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "hidden": false,
                "name": "\u547d\u4ee4\u63d0\u793a\u7b26"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "guid": "{70432362-5c3c-5966-b2d7-ea1f126451e5}",
                "hidden": false,
                "name": "Developer Command Prompt for VS 2022",
                "source": "Windows.Terminal.VisualStudio"
            },
            {
                "guid": "{ce0d7fb1-f79a-5ed3-9c19-6201dd624468}",
                "hidden": false,
                "name": "Developer PowerShell for VS 2022",
                "source": "Windows.Terminal.VisualStudio"
            },
            {
                "guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}",
                "hidden": false,
                "name": "Git Bash",
                "source": "Git"
            },
            {
                "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
                "hidden": true,
                "name": "Ubuntu-18.04",
                "source": "Windows.Terminal.Wsl"
            }
        ]
    },
    "schemes": 
    [
        {
            "background": "#0C0C0C",
            "black": "#0C0C0C",
            "blue": "#0037DA",
            "brightBlack": "#767676",
            "brightBlue": "#3B78FF",
            "brightCyan": "#61D6D6",
            "brightGreen": "#16C60C",
            "brightPurple": "#B4009E",
            "brightRed": "#E74856",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#F9F1A5",
            "cursorColor": "#FFFFFF",
            "cyan": "#3A96DD",
            "foreground": "#CCCCCC",
            "green": "#13A10E",
            "name": "Campbell",
            "purple": "#881798",
            "red": "#C50F1F",
            "selectionBackground": "#FFFFFF",
            "white": "#CCCCCC",
            "yellow": "#C19C00"
        },
        {
            "background": "#012456",
            "black": "#0C0C0C",
            "blue": "#0037DA",
            "brightBlack": "#767676",
            "brightBlue": "#3B78FF",
            "brightCyan": "#61D6D6",
            "brightGreen": "#16C60C",
            "brightPurple": "#B4009E",
            "brightRed": "#E74856",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#F9F1A5",
            "cursorColor": "#FFFFFF",
            "cyan": "#3A96DD",
            "foreground": "#CCCCCC",
            "green": "#13A10E",
            "name": "Campbell Powershell",
            "purple": "#881798",
            "red": "#C50F1F",
            "selectionBackground": "#FFFFFF",
            "white": "#CCCCCC",
            "yellow": "#C19C00"
        },
        {
            "background": "#282C34",
            "black": "#282C34",
            "blue": "#61AFEF",
            "brightBlack": "#5A6374",
            "brightBlue": "#61AFEF",
            "brightCyan": "#56B6C2",
            "brightGreen": "#98C379",
            "brightPurple": "#C678DD",
            "brightRed": "#E06C75",
            "brightWhite": "#DCDFE4",
            "brightYellow": "#E5C07B",
            "cursorColor": "#FFFFFF",
            "cyan": "#56B6C2",
            "foreground": "#DCDFE4",
            "green": "#98C379",
            "name": "One Half Dark",
            "purple": "#C678DD",
            "red": "#E06C75",
            "selectionBackground": "#FFFFFF",
            "white": "#DCDFE4",
            "yellow": "#E5C07B"
        },
        {
            "background": "#FAFAFA",
            "black": "#383A42",
            "blue": "#0184BC",
            "brightBlack": "#4F525D",
            "brightBlue": "#61AFEF",
            "brightCyan": "#56B5C1",
            "brightGreen": "#98C379",
            "brightPurple": "#C577DD",
            "brightRed": "#DF6C75",
            "brightWhite": "#FFFFFF",
            "brightYellow": "#E4C07A",
            "cursorColor": "#4F525D",
            "cyan": "#0997B3",
            "foreground": "#383A42",
            "green": "#50A14F",
            "name": "One Half Light",
            "purple": "#A626A4",
            "red": "#E45649",
            "selectionBackground": "#FFFFFF",
            "white": "#FAFAFA",
            "yellow": "#C18301"
        },
        {
            "background": "#002B36",
            "black": "#002B36",
            "blue": "#268BD2",
            "brightBlack": "#073642",
            "brightBlue": "#839496",
            "brightCyan": "#93A1A1",
            "brightGreen": "#586E75",
            "brightPurple": "#6C71C4",
            "brightRed": "#CB4B16",
            "brightWhite": "#FDF6E3",
            "brightYellow": "#657B83",
            "cursorColor": "#FFFFFF",
            "cyan": "#2AA198",
            "foreground": "#839496",
            "green": "#859900",
            "name": "Solarized Dark",
            "purple": "#D33682",
            "red": "#DC322F",
            "selectionBackground": "#FFFFFF",
            "white": "#EEE8D5",
            "yellow": "#B58900"
        },
        {
            "background": "#FDF6E3",
            "black": "#002B36",
            "blue": "#268BD2",
            "brightBlack": "#073642",
            "brightBlue": "#839496",
            "brightCyan": "#93A1A1",
            "brightGreen": "#586E75",
            "brightPurple": "#6C71C4",
            "brightRed": "#CB4B16",
            "brightWhite": "#FDF6E3",
            "brightYellow": "#657B83",
            "cursorColor": "#002B36",
            "cyan": "#2AA198",
            "foreground": "#657B83",
            "green": "#859900",
            "name": "Solarized Light",
            "purple": "#D33682",
            "red": "#DC322F",
            "selectionBackground": "#FFFFFF",
            "white": "#EEE8D5",
            "yellow": "#B58900"
        },
        {
            "background": "#000000",
            "black": "#000000",
            "blue": "#3465A4",
            "brightBlack": "#555753",
            "brightBlue": "#729FCF",
            "brightCyan": "#34E2E2",
            "brightGreen": "#8AE234",
            "brightPurple": "#AD7FA8",
            "brightRed": "#EF2929",
            "brightWhite": "#EEEEEC",
            "brightYellow": "#FCE94F",
            "cursorColor": "#FFFFFF",
            "cyan": "#06989A",
            "foreground": "#D3D7CF",
            "green": "#4E9A06",
            "name": "Tango Dark",
            "purple": "#75507B",
            "red": "#CC0000",
            "selectionBackground": "#FFFFFF",
            "white": "#D3D7CF",
            "yellow": "#C4A000"
        },
        {
            "background": "#FFFFFF",
            "black": "#000000",
            "blue": "#3465A4",
            "brightBlack": "#555753",
            "brightBlue": "#729FCF",
            "brightCyan": "#34E2E2",
            "brightGreen": "#8AE234",
            "brightPurple": "#AD7FA8",
            "brightRed": "#EF2929",
            "brightWhite": "#EEEEEC",
            "brightYellow": "#FCE94F",
            "cursorColor": "#000000",
            "cyan": "#06989A",
            "foreground": "#555753",
            "green": "#4E9A06",
            "name": "Tango Light",
            "purple": "#75507B",
            "red": "#CC0000",
            "selectionBackground": "#FFFFFF",
            "white": "#D3D7CF",
            "yellow": "#C4A000"
        },
        {
            "background": "#300A24",
            "black": "#171421",
            "blue": "#0037DA",
            "brightBlack": "#767676",
            "brightBlue": "#08458F",
            "brightCyan": "#2C9FB3",
            "brightGreen": "#26A269",
            "brightPurple": "#A347BA",
            "brightRed": "#C01C28",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#A2734C",
            "cursorColor": "#FFFFFF",
            "cyan": "#3A96DD",
            "foreground": "#FFFFFF",
            "green": "#26A269",
            "name": "Ubuntu-18.04-ColorScheme",
            "purple": "#881798",
            "red": "#C21A23",
            "selectionBackground": "#FFFFFF",
            "white": "#CCCCCC",
            "yellow": "#A2734C"
        },
        {
            "background": "#000000",
            "black": "#000000",
            "blue": "#000080",
            "brightBlack": "#808080",
            "brightBlue": "#0000FF",
            "brightCyan": "#00FFFF",
            "brightGreen": "#00FF00",
            "brightPurple": "#FF00FF",
            "brightRed": "#FF0000",
            "brightWhite": "#FFFFFF",
            "brightYellow": "#FFFF00",
            "cursorColor": "#FFFFFF",
            "cyan": "#008080",
            "foreground": "#C0C0C0",
            "green": "#008000",
            "name": "Vintage",
            "purple": "#800080",
            "red": "#800000",
            "selectionBackground": "#FFFFFF",
            "white": "#C0C0C0",
            "yellow": "#808000"
        }
    ],
    "theme": "system",
    "themes": [],
    "useAcrylicInTabRow": true
}

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 13, 2023
@littlewhitecloud
Copy link
Author

Also failed in the 1.17.11461.0
image

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 13, 2023
@littlewhitecloud
Copy link
Author

image

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  3031

@littlewhitecloud
Copy link
Author

@zadjii-msft how to get the version of psreadline?

@littlewhitecloud
Copy link
Author

Also failed in the original powershell & cmd
image
image

@zadjii-msft
Copy link
Member

PowerShell recommends pasting the following block:

The following script will generate the environment data that helps triage and investigate the issue.
Please run the script in the PowerShell session where you ran into the issue, and paste the verbatim output below.

& {
    $hostName = $Host.Name
    if ($hostName -eq "ConsoleHost" -and (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)) {
        $id = $PID; $inWindowsTerminal = $false
        while ($true) {
            $p = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId Like $id"
            if (!$p -or !$p.Name) { break }
            if ($p.Name -eq "WindowsTerminal.exe") { $inWindowsTerminal = $true; break }
            $id = $p.ParentProcessId
        }
        if ($inWindowsTerminal) { $hostName += " (Windows Terminal)" }
    }

    $m = Get-Module PSReadline
    $v = $m.Version; $pre = $m.PrivateData.PSData.Prerelease
    if ($pre) { $v = "$v-$pre" }
    $os = if ($IsLinux -or $IsMacOS) { uname -a } else { (dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion }

    Write-Host ''
    Write-Host "PS Version: $($PSVersionTable.PSVersion)"
    Write-Host "PS HostName: $hostName"
    Write-Host "PSReadLine Version: $v"
    Write-Host "PSReadLine EditMode: $((Get-PSReadLineOption).EditMode)"
    Write-Host "OS: $os"
    Write-Host "BufferWidth: $([console]::BufferWidth)"
    Write-Host "BufferHeight: $([console]::BufferHeight)"
    Write-Host ''
}

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 13, 2023
@littlewhitecloud
Copy link
Author

Thanks!
image

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 13, 2023
@littlewhitecloud
Copy link
Author

PS Version: 5.1.19041.3031
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.3085 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 3000

@237dmitry
Copy link

In Windows PowerShell (5.1):
Screenshot 2023-07-13 142258

@zadjii-msft
Copy link
Member

If you hit enter to submit that command (with the emoji appearing as ?), do you get a stack trace/?

I'm guessing this is some variation on PowerShell/PSReadLine#949 or PowerShell/PSReadLine#2358. Updating PsReadline might help with the display of the emoji.

@littlewhitecloud
Copy link
Author

image

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Powershell Issues in the modern command interpreter, Powershell.exe. Resolution-External For issues that are outside this codebase and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 13, 2023
@littlewhitecloud
Copy link
Author

littlewhitecloud commented Jul 14, 2023

If you hit enter to submit that command (with the emoji appearing as ?), do you get a stack trace/?

I'm guessing this is some variation on PowerShell/PSReadLine#949 or PowerShell/PSReadLine#2358. Updating PsReadline might help with the display of the emoji.

I didn't get a stack trace and show it correctly.
image

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 14, 2023
@littlewhitecloud
Copy link
Author

littlewhitecloud commented Jul 14, 2023

How to update PSReadLine?

@237dmitry
Copy link

237dmitry commented Jul 14, 2023

How to update PSReadLine?

Set-PSRepository PSGallery -InstallationPolicy Trusted
Update-Module PSReadline -Scope CurrentUser

But I think this is not PSReadline issue. Rather system locale. In my case there is UTF8:

Win+R > intl.cpl

@littlewhitecloud
Copy link
Author

How to update PSReadLine?

Set-PSRepository PSGallery -InstallationPolicy Trusted
Update-Module PSReadline -Scope CurrentUser

But I think this is not PSReadline issue. Rather system locale. In my case there is UTF8:

Win+R > intl.cpl

Does not work for me, I found a way to update it

Install-Module PSReadLine -Force

@littlewhitecloud
Copy link
Author

After updating the PSReadLine it can show the emoji correctly!
image
Thanks!
(But I advise to force update powershell when Terminal install)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Powershell Issues in the modern command interpreter, Powershell.exe. Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

3 participants