Pasting into PowerShell running in Windows Terminal drops Unicode characters #12202

Open
opened 2026-01-31 03:08:56 +00:00 by claunia · 0 comments
Owner

Originally created by @sba923 on GitHub (Jan 26, 2021).

Environment

Windows build number: 10.0.18363.1256
Windows Terminal version (if applicable): 1.4.3243.0
PowerShell 7.1.1
Windows PowerShell 5.1
PSReadLine 2.2.0 beta1

Steps to reproduce

  1. Put the following string on the clipboard: C:\tmp\Captures d’écran where the ’ is U+2019

(Verify as follows:

PS> $p=(Get-ClipboardText); for($i=0;$i -lt $p.Length; $i++) { '{0} {1:x4}' -f $p[$i], [int]($p[$i]) }
C 0043
: 003a
\ 005c
t 0074
m 006d
p 0070
\ 005c
C 0043
a 0061
p 0070
t 0074
u 0075
r 0072
e 0065
s 0073
  0020
d 0064
’ 2019
é 00e9
c 0063
r 0072
a 0061
n 006e

)

  1. Create a folder with this name e.g. using mkdir -Force (Get-ClipboardText) in PowerShell.
  2. In a PowerShell 7.1.1 or Windows PowerShell 5.1 session, type gci " followed by Ctrl+V followed by " followed by Enter.

Expected behavior

Whether PowerShell runs standalone or within Windows Terminal, this should work and show the contents of the C:\tmp\Captures d’écran folder.

Actual behavior

If PowerShell runs within Windows Terminal, the paste action drops the U+2019 character, resulting in an error:

PS> gci "C:\tmp\Captures décran"
Get-ChildItem: Cannot find path 'C:\tmp\Captures décran' because it does not exist.

The paste action works fine in a CMD prompt running within Windows Terminal.

Could that be the result of an interaction / incompatibility between PSReadLine and Windows Terminal?

Originally created by @sba923 on GitHub (Jan 26, 2021). # Environment ```none Windows build number: 10.0.18363.1256 Windows Terminal version (if applicable): 1.4.3243.0 PowerShell 7.1.1 Windows PowerShell 5.1 PSReadLine 2.2.0 beta1 ``` # Steps to reproduce 1. Put the following string on the clipboard: `C:\tmp\Captures d’écran` where the `’` is U+2019 (Verify as follows: ```` PS> $p=(Get-ClipboardText); for($i=0;$i -lt $p.Length; $i++) { '{0} {1:x4}' -f $p[$i], [int]($p[$i]) } C 0043 : 003a \ 005c t 0074 m 006d p 0070 \ 005c C 0043 a 0061 p 0070 t 0074 u 0075 r 0072 e 0065 s 0073 0020 d 0064 ’ 2019 é 00e9 c 0063 r 0072 a 0061 n 006e ```` ) 2. Create a folder with this name e.g. using `mkdir -Force (Get-ClipboardText)` in PowerShell. 3. In a PowerShell 7.1.1 or Windows PowerShell 5.1 session, type `gci "` followed by `Ctrl+V` followed by `"` followed by `Enter`. # Expected behavior Whether PowerShell runs standalone or within Windows Terminal, this should work and show the contents of the `C:\tmp\Captures d’écran` folder. # Actual behavior If PowerShell runs within Windows Terminal, the paste action drops the U+2019 character, resulting in an error: ```` PS> gci "C:\tmp\Captures décran" Get-ChildItem: Cannot find path 'C:\tmp\Captures décran' because it does not exist. ```` The paste action works fine in a `CMD` prompt running within Windows Terminal. Could that be the result of an interaction / incompatibility between PSReadLine and Windows Terminal?
claunia added the Needs-TriageResolution-ExternalNeeds-Tag-FixProduct-Powershell labels 2026-01-31 03:08:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12202