-
Notifications
You must be signed in to change notification settings - Fork 305
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
adding an emoji triggered an exception #1282
Comments
I do not believe that ConsoleHost (the terminal that PowerShell and PSReadLine reside in on Windows) supports emoji's. The exception occurs when the command is being saved to the history file. Of course, this exception causes the command to not execute, but if Enter is pressed again, it should. The exception occurs because the history file writing method doesn't seem to know how to encode an emoji in the selected file format (which I am not sure what format that is). This would be a duplicate of #949. |
@msftrncs It does actually. Write-Host an emoji works. And inserting an emoji and pressing enter, shows that emoji as command not found. On input it shows "??". Adding a space inbetween (which does not make the multibyte string an emoji anymore) breaks the terminal. |
That is not ConsoleHost, that is Windows Terminal. I missed that in your original post. You are correct, Windows Terminal does support Emoji, but ConsoleHost does not. (This may sound confusing since Windows Terminal is listed as Do not add a space between the So there really is no issue here I think. Also, you might find the latest version of PSReadLine (2.0.0-rc1) supports these characters better. Sorry for any previous confusion. |
The |
First I tried copy and pasting to the console (used some parts of the config file).
Then I added an emoji using win+., added a space between these
??
that appeared instead of the emoji and pressed enterWas wondering, why an emoji would not show up on the terminal.
Output
Environment data
PS version: 5.1.18362.145
PSReadline version: 2.0.0-beta2
os: 10.0.18362.530 (WinBuild.160101.0800)
PS file version: 10.0.18362.530 (WinBuild.160101.0800)
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 154
BufferHeight: 39
Steps to reproduce or exception report
"Type" an emoji, add a space between the 2
??
and press enter.The text was updated successfully, but these errors were encountered: