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

Visual studio code #3793

Closed
3 tasks done
vaibhavupase opened this issue Sep 4, 2023 · 3 comments
Closed
3 tasks done

Visual studio code #3793

vaibhavupase opened this issue Sep 4, 2023 · 3 comments

Comments

@vaibhavupase
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.22621.1778
OS: Microsoft Windows 10.0.22621
Last 200 Keys

 ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      

Exception

System.Text.EncoderFallbackException: Unable to translate Unicode character \uD83E at index 0 to specified code page.
   at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
   at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
   at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, EncoderNLS baseEncoder)
   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__DisplayClass83_0.<WriteHistoryRange>b__0()
   at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
   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)

Screenshot

Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new

Environment

PSReadLine: 2.0.0
PowerShell: 5.1.22621.1778
OS: Microsoft Windows 10.0.22621
Last 200 Keys

 ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      

Exception

System.Text.EncoderFallbackException: Unable to translate Unicode character \uD83E at index 0 to specified code page.
   at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
   at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
   at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, EncoderNLS baseEncoder)
   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__DisplayClass83_0.<WriteHistoryRange>b__0()
   at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
   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)

### Environment data

```console
Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.22621.1778
OS: Microsoft Windows 10.0.22621
Last 200 Keys

 ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      

Exception

System.Text.EncoderFallbackException: Unable to translate Unicode character \uD83E at index 0 to specified code page.
   at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
   at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
   at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, EncoderNLS baseEncoder)
   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__DisplayClass83_0.<WriteHistoryRange>b__0()
   at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
   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)

Steps to reproduce

Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new

Environment

PSReadLine: 2.0.0
PowerShell: 5.1.22621.1778
OS: Microsoft Windows 10.0.22621
Last 200 Keys

 ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      

Exception

System.Text.EncoderFallbackException: Unable to translate Unicode character \uD83E at index 0 to specified code page.
   at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
   at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
   at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, EncoderNLS baseEncoder)
   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__DisplayClass83_0.<WriteHistoryRange>b__0()
   at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
   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)

### Expected behavior

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0
PowerShell: 5.1.22621.1778
OS: Microsoft Windows 10.0.22621
Last 200 Keys

( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter
c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter
c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter


### Exception

System.Text.EncoderFallbackException: Unable to translate Unicode character \uD83E at index 0 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, EncoderNLS baseEncoder)
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__DisplayClass83_0.b__0()
at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
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)

Actual behavior

Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new

Environment

PSReadLine: 2.0.0
PowerShell: 5.1.22621.1778
OS: Microsoft Windows 10.0.22621
Last 200 Keys

 ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      
 c d Spacebar " d : \ c w h Spacebar Spacebar C \ v a i b h a v C \ B i n a r y B r a i n s \ " Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar g c c Spacebar L o o p . c Spacebar - o Spacebar L o o p Spacebar } Spacebar ; Spacebar i f Spacebar ( $ ? ) Spacebar { Spacebar . \ L o o p Spacebar } Enter      

Exception

System.Text.EncoderFallbackException: Unable to translate Unicode character \uD83E at index 0 to specified code page.
   at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
   at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
   at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, EncoderNLS baseEncoder)
   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__DisplayClass83_0.<WriteHistoryRange>b__0()
   at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
   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)
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Sep 4, 2023
@StevenBucher98
Copy link
Collaborator

Thanks for the issue @vaibhavupase ! Can you try upgrading to PSReadLine's latest stable version 2.2.6 with this command:

Install-Module -Name PSReadLine -RequiredVersion 2.2.6

And see if this resolves your issue? If this does not solve your issue, please provide reproducible steps for getting this exception.

@StevenBucher98 StevenBucher98 added Needs-Author Feedback Issue-Bug It either shouldn't be doing this or needs an investigation. Area-Stability Label for tracking stability Issues labels Sep 5, 2023
@daxian-dbw
Copy link
Member

Close as a duplicate of #2358

@daxian-dbw daxian-dbw added Issue-Emoji and removed Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. Needs-Author Feedback Area-Stability Label for tracking stability Issues labels Sep 6, 2023
@daxian-dbw
Copy link
Member

This is a duplicate of #3832 and is actually an issue with the older version of conpty that ships with Windows -- the � shown in VSCode terminal was because only the high surrogate of the surrogate pair that represents the emoji was pasted into the read-line buffer, due to the older version of conpty not handling it correctly.

See #3832 (comment) and the replying comment from @Tyriar for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants