PSReadLine Exception when filtering with replacement character �
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 55/100
Rechercherichtung
Start by tracing the history write path named in the exception, from MaybeAddToHistory through IncrementalHistoryWrite to WriteHistoryRange; the report points to history serialization as the failure site. Reproduce in PowerShell 7.6.9 with PSReadLine 2.4.5 by entering the reported replacement character filter and checking history writing. Done means the command causes no EncoderFallbackException.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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 ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!
### Environment
PSReadLine: 2.4.5
PowerShell: 7.6.9
OS: Microsoft Windows 10.0.20348
BufferWidth: 317
BufferHeight: 9001
Last 200 Keys:
e c t o r y D e l e t e d I t e m A s G r o u p Spacebar - A l l Enter
$ d e t e l e t Backspace Backspace Backspace t e d I t e m s Enter
G e t - M g D i r e c t o r y D e l e t e d I t e m A s G r o u p Enter
Enter
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 Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace UpArrow UpArrow Enter
UpArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow RightArrow Backspace l ; Backspace Enter
UpArrow . d e s c r i p t i o n Spacebar - = Backspace l i k e Spacebar ' ' LeftArrow � � Backspace * Enter
Enter
Enter
Enter
Enter
Enter
UpArrow Enter
UpArrow LeftArrow LeftArrow Backspace T Enter
UpArrow UpArrow LeftArrow LeftArrow Enter
LeftArrow LeftArrow Spacebar Enter
### Exception
System.Text.EncoderFallbackException: Unable to translate Unicode character \\uD83D at index 33 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__DisplayClass104_0.<WriteHistoryRange>b__0()
at Microsoft.PowerShell.PSConsoleReadLine.<>c__DisplayClass104_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
Environment data
PS Version: 7.6.9
PS HostName: ConsoleHost
PSReadLine Version: 2.4.5
PSReadLine EditMode: Windows
OS: 10.0.20348.4647 (WinBuild.160101.0800)
BufferWidth: 317
BufferHeight: 9001
Steps to reproduce
$deleteditems = Get - MgDirectoryDeletedItemAsGroup
$deletedItems.description -like '�*'
Expected behavior
No exception
Actual behavior
the above happens
- Vorherrschende Sprache
- C#
- Sterne
- 4.4k
- Forks
- 345
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PowerShell/PSReadLine
-
Get-PSReadLineOption emits the ListView window-size warning, so prompt modules trigger it on every shell startEvtl. vergeben @thc1006 hat das vor 63 Tagen übernommen. OffenNeeds-Triage :mag:
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
PowerShell/PSReadLine#3470 · 3 Reaktionen ·
Alle Issues in PowerShell/PSReadLine
Ähnliche Issues
-
effort:S P3 refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
nightscout/nocturne#3243 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
dasher-project/Dasher-Windows#84 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
libnativeapi/nativeapi#21 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 3 Tagen
-
enhancement P3 performance
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
thomhurst/TUnit#7380 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag