question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invisible symbol: paste "€" in PowerShell 7.2.0-preview.5

See original GitHub issue

Steps to reproduce

copy to clipboard "item=1000€"

✔paste in Windows PowerShell PS C:\Users\jeffery> "item=1000€"

❌paste in PowerShell 7.2.0-preview.5 PS C:\Users\jeffery> "item=1000"

Expected behavior && Actual behavior

image

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.5
PSEdition                      Core
GitCommitId                    7.2.0-preview.5
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Name                           Value
----                           -----
PSVersion                      5.1.19041.906
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.906
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
daxian-dbwcommented, Mar 7, 2023

As I read through the comments, it seems this is still an issue that only reproduces with mouse right clicking, not with the <kbd>Ctrl+v</kbd> key-binding. If so, then this is due to the .NET issue https://github.com/dotnet/runtime/issues/38966.

I can only reproduce the issue in conhost from Windows 11 – the Unicode char is skipped when right-clicking paste, but not when pasting with <kbd>Ctrl+v</kbd>. Both work fine in Windows Terminal for me.

There are quite a few duplicate issues in PSReadLine/PowerShell repos due to the same .NET issue:

2reactions
Tyriarcommented, Jun 1, 2022

@StevenBucher98 I can reproduce the problem in pwsh 7.2.4.

The difference in right click and ctrl+v in VS Code is explained because we have this keybinding built-in:

   { "key": "ctrl+v",                "command": "workbench.action.terminal.sendSequence",
                                     "when": "terminalFocus && !accessibilityModeEnabled && terminalShellType == 'pwsh'",
                                     "args": {"text":"\u0016"} },

This allows PSReadLine to handle pasting which does a better job with multi-line strings. Right click just does a regular paste and I don’t think we should fix this to have a similar send a sequence to PSReadLine on click until custom mouse bindings are implemented (https://github.com/microsoft/vscode/issues/3130).

So the problem here is pwsh for some reason filters out the character, the fact that it works fine in cmd.exe means this is a problem in pwsh. Can you please reopen this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

about Special Characters - PowerShell
Describes the special character sequences that control how PowerShell interprets the next characters in the sequence.
Read more >
unicode - PowerShell script runs when pasted into the ...
When Windows PowerShell reads this sequence as "ANSI"-encoded, it considers each byte a character in its own right, which is why you saw...
Read more >
Troubleshooting Invisible / Hidden Characters in your ...
Recently I was helping a colleague with a PowerShell script, things were going great until we ran the code and nothing was outputting....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found