Skip to content

Some emoji, eg 'πŸ˜ƒ' don't work, whereas others like '⏰' doΒ #1329

Open

Description

Moved from microsoft/terminal#1606

Using app store preview build of Windows Terminal, with win+. to send πŸ˜ƒ and then ⏰:

image

Dustin L. Howett (MSFT) (@DHowett-MSFT) mentioned it's likely not a Windows Terminal issue:

Powershell has trouble with high unicode input ... and there's not much we can do to help that.


Name                           Value
----                           -----
PSVersion                      6.2.1
PSEdition                      Core
GitCommitId                    6.2.1
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. vexx32 commented on Jun 27, 2019

    @vexx32

    I wonder if this is due to PS itself or PSReadLine...

    Can you Remove-Module PSReadline and try it again?

  2. mikemaccana commented on Jun 27, 2019

    @mikemaccana
    Author

    After Remove-Module PSReadline

    image

  3. vexx32 commented on Jun 27, 2019

    @vexx32

    Interesting. Input doesn't like it much, but output is OK.

    I'd venture to say this is probably an issue both for PS itself in places and the PSReadLine module as well,

    Dongbo Wang (@daxian-dbw) any thoughts on this?

  4. iSazonov commented on Oct 2, 2019

    @iSazonov

    /cc Dongbo Wang (@daxian-dbw) Steve Lee (@SteveL-MSFT) Should we track the issue here or in PSREadline repo?

  5. SteveL-MSFT commented on Oct 2, 2019

    @SteveL-MSFT
    Member

    Seems like there is an issue in both PS and PSRL. We can keep this issue here for now. Removing PSRL and on macOS, simply pasting "πŸ˜ƒ results in οΏ½"πŸ˜ƒοΏ½. Quite strange.

  6. SteveL-MSFT commented on Oct 3, 2019

    @SteveL-MSFT
    Member

    chuanjiao10 that may be true on Windows, but on macOS there is still an issue although perhaps different from the original issue

  7. daxian-dbw commented on Oct 9, 2019

    @daxian-dbw
    Member

    In Windows Terminal, garbage characters may appear when deleting the emoji character.

  8. iSazonov commented on Jan 31, 2020

    @iSazonov

    Dongbo Wang (@daxian-dbw) Is any updates in PSRL with the issue?

  9. daxian-dbw commented on Jan 31, 2020

    @daxian-dbw
    Member

    Ilya (@iSazonov) Unfortunately, no news from the PSReadLine side. also, as mentioned in this issue, the same repros without PSReadLine.

  10. DHowett-MSFT commented on Jan 31, 2020

    @DHowett-MSFT

    PSReadline uses raw input and non-PSReadline uses COOKED_READ in the console host. One of these things can never be fixed πŸ˜„

  11. iSazonov commented on Jan 31, 2020

    @iSazonov

    I'd prefer to get updated COOKED_READ in Core.

  12. DHowett-MSFT commented on Jan 31, 2020

    @DHowett-MSFT

    Cooked read is provided by conhost.exe, not Core, and we cannot change it without significantly impacting application compatibility all across Windows. Raw input with a readline-like library is the correct thing to do.

  13. iSazonov commented on Jan 31, 2020

    @iSazonov

    Raw input with a readline-like library is the correct thing to do.

    I mean that this must be in Core so that we do not re-implement this in every application. Is there a tracking issue?

  14. ghost added
    Needs-Triage πŸ”It's a new issue that core contributor team needs to triage.
    on Jan 31, 2020
  15. 9 remaining items

  16. daxian-dbw commented on Jun 5, 2020

    @daxian-dbw
    Member

    Patrick Meinecke (@SeeminglyScience) Yes, please open a new issue for Delete. Thanks!

  17. daxian-dbw commented on Jun 10, 2020

    @daxian-dbw
    Member
  18. rayphi commented on Aug 27, 2020

    @rayphi

    I've got also an Exception for a πŸ’„in my commit message.

    Exception:

    System.Text.EncoderFallbackException: Unable to translate Unicode character \\uD83D at index 10 to specified code page.
       at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
       at System.Text.EncoderFallbackBuffer.InternalFallback(ReadOnlySpan`1 chars, Int32& charsConsumed)
       at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan`1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder)
       at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar, EncoderNLS encoder)
       at System.Text.Encoding.GetBytes(Char* pChars, Int32 charCount, Byte* pBytes, Int32 byteCount, EncoderNLS encoder)
       at System.Text.EncoderNLS.GetBytes(Char[] chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, Boolean flush)
       at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
       at System.IO.StreamWriter.Dispose(Boolean disposing)
       at System.IO.TextWriter.Dispose()
       at Microsoft.PowerShell.PSConsoleReadLine.<>c__DisplayClass81_0.<WriteHistoryRange>b__0()
       at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
       at Microsoft.PowerShell.PSConsoleReadLine.WriteHistoryRange(Int32 start, Int32 end, Func`2 fileOpener)
       at Microsoft.PowerShell.PSConsoleReadLine.IncrementalHistoryWrite()
       at Microsoft.PowerShell.PSConsoleReadLine.MaybeAddToHistory(String result, List`1 edits, Int32 undoEditIndex, Boolean fromDifferentSession, Boolean fromInitialRead)
       at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
    
  19. chenshuai2144 commented on Sep 1, 2020

    @chenshuai2144

    I have same error
    image

  20. ninmonkey commented on May 1, 2021

    @ninmonkey

    This caused by PSReadLine itself

    Error Case:

    1. Create a filename that requires surrogate pairs, include a πŸ–₯️ or πŸ˜€
    2. copy a path to your clipboard
    3. type gi ' then paste the path

    File not found

    I verified gi (get-clipboard) does have the right path.

    Working Case: Remove-Module

    1. run Remove-Module PSReadLine
    2. Paste like the first test

    Get-Item does find the file

    image

    Notes:

    It doesn't seem to matter whether the 3 encodings are set to utf16le vs utf8
    [console]::InputEncoding, [console]::OutputEncoding, $OutputEncoding

    Even though the terminal didn't render the runes correctly, the paste still was the valid path
    image

  21. StevenBucher98 commented on Jan 4, 2023

    @StevenBucher98
    Collaborator

    Revisiting this issue, I dont seem to get any errors copying and pasting large sets of emojis in Windows Terminal with PowerShell 7.3.1 and PSReadLine 2.2.6

    image

    Without windows Terminal it seems to be okay but has little different rendering and a few ??

    image

    With Mac it gets a little messy with more than like 2 emojis, see screen recording

    Uploading Screen Recording 2023-01-04 at 9.14.48 AM.mov…

  22. UsmanTariq2 commented on Feb 7, 2024

    @UsmanTariq2

    Has this issue been fixed?
    Whenever i enter a emoji like πŸ€‘the windows terminal shows οΏ½ οΏ½ instead of rendering the proper emoji in the terminal when inputting an emoji
    The information provided here is confusing me that is why asking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions