You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Console.ReadKey returns incomplete VT sequences for bracketed paste #60101
The Bracketed Paste Mode can be enabled by writing \e[?2004h to STDOUT on a terminal that supports the mode. When pasting text with the Bracketed Paste Mode turned on, the terminal will wrap the copied text by the start sequences \e[200~ and the end sequences \e[201~.
Today, Console.ReadKey returns a set of VT sequences for the start/end of bracketed paste.
As is shown in the below screenshot, when pasting the letter C in WSL 2 with Windows Terminal (either by Ctrl+Shift-v or right-clicking), Console.ReadKey returns "\e200~C\e201~". It's essentially the expected start/end sequences for bracketed paste, but [ is missing from both.
Question 1: Is it a bug that [ is missed from the VT sequences returned by Console.ReadKey?
Question 2: Is the current behavior of Console.ReadKey regarding Bracketed Paste Mode supposed to be reliable or it just happens to work this way? Can an application depend on today's behavior to handle bracketed paste (e.g. powershell)?
Activity
daxian-dbw commentedon Oct 7, 2021
/cc @lzybkr, @SteveL-MSFT and @DHowett-MSFT FYI
jeffhandley commentedon Jul 9, 2022
@adamsitnik Another scenario worth re-testing with #802
adamsitnik commentedon Aug 10, 2022
Fixed by #72193
daxian-dbw commentedon Aug 10, 2022
Quote from #73257 (comment):