-
Notifications
You must be signed in to change notification settings - Fork 317
Closed
Labels
Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.There's another issue on the tracker that's pretty much the same thing.
Description
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
### Environment
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.4.7
OS: Microsoft Windows 10.0.26100
BufferWidth: 120
BufferHeight: 30
Last 70 Keys:
UpArrow UpArrow UpArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace m a i n . p t Enter
UpArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace m i Backspace Backspace u v Spacebar r u n Spacebar m a i n RightArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace Enter
### Exception
System.Text.EncoderFallbackException: Unable to translate Unicode character \\uDB40 at index 36 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan`1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder, Boolean throwForDestinationOverflow)
at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar, EncoderNLS encoder)
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__DisplayClass103_0.<WriteHistoryRange>b__0()
at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
at Microsoft.PowerShell.PSConsoleReadLine.WriteHistoryRange(Int32 start, Int32 end, Boolean overwritten)
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, Nullable`1 lastRunStatus)Screenshot
n/a
Environment data
PS Version: 7.4.7
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 30Steps to reproduce
pressing backspace on some 3 byte wide unicode character will trigger this error upon clicking enter
Expected behavior
it would handle bad unicode accordingly
Actual behavior
throws the error, then processes them accordingly if tried again until you change the prompt
Metadata
Metadata
Assignees
Labels
Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.There's another issue on the tracker that's pretty much the same thing.