microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.34k stars 8.29k forks source link

COOKED_READ (cmd.exe) doesn't properly support emoji input #1503

Closed peter-bertok closed 1 year ago

peter-bertok commented 5 years ago

Environment

Windows build number: 1903
Windows Terminal version (if applicable): 0.2.1715.0

Steps to reproduce

Paste text containing complex Unicode characters such as emoji into a PowerShell tab as a string literal. Emoji will be displayed as "??" placeholders, but then display correctly when the literal is "output" by pressing enter.

Expected behavior

Unicode characters such as Emoji should be consistently displayed, including in string literals, input text, command-line arguments, etc...

Actual behavior

Inconsistent display:

Screenshot

DHowett-MSFT commented 5 years ago

This one is fascinating. I spy two bugs here. One is with the emoji input (this could just be PSReadline's fault), and the other is that some emoji are still too tiny!

Shorotshishir commented 5 years ago

dumping any of the two files in the terminal doesn't render any data properly. these two files ocntails all the emojis that windows provide.

CMD: use more or type to dump content into the terminal. shows garbage text, but doesn't crash

PowerShell use get-content to dump the data into the terminal nothing shows , hangs the terminal app and crashes

WSL use cat to dump the content into the terminal nothing shows, hangs the terminal app and crashes

N.B. --> Crash doesn't terminate terminal app

davidhewitt commented 4 years ago

Pasting emoji input is also an issue with cmd. In the screenshot below, I paste a string of smileys in, but they come out as invalid glyphs.

Hitting enter and up displays the correct input string though, so it is making it into the console buffer correctly.

image

zadjii-msft commented 4 years ago

For me later:

Emoji.txt ๐Ÿ˜๐Ÿ˜๐Ÿ˜‚๐Ÿคฃ๐Ÿ˜ƒ๐Ÿ˜„๐Ÿ˜…๐Ÿ˜†๐Ÿ˜‰๐Ÿ˜Š๐Ÿ˜‹๐Ÿ˜Ž๐Ÿ˜๐Ÿ˜˜๐Ÿฅฐ๐Ÿ˜—๐Ÿ˜™๐Ÿ˜šโ˜บ๐Ÿ™‚๐Ÿค—๐Ÿคฉ๐Ÿค”๐Ÿคจ๐Ÿ˜๐Ÿ˜‘๐Ÿ˜ถ๐Ÿ™„๐Ÿ˜๐Ÿ˜ฃ๐Ÿ˜ฅ๐Ÿ˜ฎ๐Ÿค๐Ÿ˜ฏ๐Ÿ˜ช๐Ÿ˜ซ๐Ÿฅฑ๐Ÿ˜ด๐Ÿ˜Œ๐Ÿ˜›๐Ÿ˜œ๐Ÿ˜๐Ÿคค๐Ÿ˜’๐Ÿ˜“๐Ÿ˜”๐Ÿ˜•๐Ÿ™ƒ๐Ÿค‘๐Ÿ˜ฒโ˜น๐Ÿ™๐Ÿ˜–๐Ÿ˜ž๐Ÿ˜Ÿ๐Ÿ˜ค๐Ÿ˜ข๐Ÿ˜ญ๐Ÿ˜ฆ๐Ÿ˜ง๐Ÿ˜จ๐Ÿ˜ฉ๐Ÿคฏ๐Ÿ˜ฌ๐Ÿ˜ฐ๐Ÿ˜ฑ๐Ÿฅต๐Ÿฅถ๐Ÿ˜ณ๐Ÿคช๐Ÿ˜ต๐Ÿฅด๐Ÿ˜ ๐Ÿ˜ก๐Ÿคฌ๐Ÿ˜ท๐Ÿค’๐Ÿค•๐Ÿคข๐Ÿคฎ๐Ÿคง๐Ÿ˜‡๐Ÿฅณ๐Ÿฅบ๐Ÿค ๐Ÿคก๐Ÿคฅ๐Ÿคซ๐Ÿคญ๐Ÿง๐Ÿค“๐Ÿ˜ˆ๐Ÿ‘ฟ๐Ÿ‘น๐Ÿ‘บ๐Ÿ’€โ˜ ๐Ÿ‘ป๐Ÿ‘ฝ๐Ÿ‘พ๐Ÿค–๐Ÿ’ฉ๐Ÿ˜บ๐Ÿ˜ธ๐Ÿ˜น๐Ÿ˜ป๐Ÿ˜ผ๐Ÿ˜ฝ๐Ÿ™€๐Ÿ˜ฟ๐Ÿ˜พ๐Ÿฑโ€๐Ÿ‘ค๐Ÿฑโ€๐Ÿ๐Ÿฑโ€๐Ÿ’ป๐Ÿฑโ€๐Ÿ‰๐Ÿฑโ€๐Ÿ‘“๐Ÿฑโ€๐Ÿš€๐Ÿ™ˆ๐Ÿ™‰๐Ÿ™Š๐Ÿต๐Ÿถ๐Ÿบ๐Ÿฑ๐Ÿฆ๐Ÿฏ๐Ÿฆ’๐ŸฆŠ๐Ÿฆ๐Ÿฎ๐Ÿท๐Ÿ—๐Ÿญ๐Ÿน๐Ÿฐ๐Ÿป๐Ÿจ๐Ÿผ๐Ÿธ๐Ÿฆ“๐Ÿด๐Ÿฆ„๐Ÿ”๐Ÿฒ๐Ÿฝ๐Ÿพ๐Ÿ’๐Ÿฆ๐Ÿฆง๐Ÿฆฎ๐Ÿ•โ€๐Ÿฆบ๐Ÿฉ๐Ÿ•๐Ÿˆ๐Ÿ…๐Ÿ†๐ŸŽ๐ŸฆŒ๐Ÿฆ๐Ÿฆ›๐Ÿ‚๐Ÿƒ๐Ÿ„๐Ÿ–๐Ÿ๐Ÿ‘๐Ÿ๐Ÿช๐Ÿซ๐Ÿฆ™๐Ÿฆ˜๐Ÿฆฅ๐Ÿฆจ๐Ÿฆก๐Ÿ˜๐Ÿ๐Ÿ€๐Ÿฆ”๐Ÿ‡๐Ÿฟ๐ŸฆŽ๐ŸŠ๐Ÿข๐Ÿ๐Ÿ‰๐Ÿฆ•๐Ÿฆ–๐Ÿฆฆ๐Ÿฆˆ๐Ÿฌ๐Ÿณ๐Ÿ‹๐ŸŸ๐Ÿ ๐Ÿก๐Ÿฆ๐Ÿฆ‘๐Ÿ™๐Ÿฆž๐Ÿฆ€๐Ÿš๐Ÿฆ†๐Ÿ“๐Ÿฆƒ๐Ÿฆ…๐Ÿ•Š๐Ÿฆข๐Ÿฆœ๐Ÿฆฉ๐Ÿฆš๐Ÿฆ‰๐Ÿฆ๐Ÿง๐Ÿฅ๐Ÿค๐Ÿฃ๐Ÿฆ‡๐Ÿฆ‹๐ŸŒ๐Ÿ›๐ŸฆŸ๐Ÿฆ—๐Ÿœ๐Ÿ๐Ÿž๐Ÿฆ‚๐Ÿ•ท๐Ÿ•ธ๐Ÿฆ ๐Ÿงžโ€โ™€๏ธ๐Ÿงžโ€โ™‚๏ธ๐Ÿ—ฃ๐Ÿ‘ค๐Ÿ‘ฅ๐Ÿ‘๐Ÿ‘€๐Ÿฆด๐Ÿฆท๐Ÿ‘…๐Ÿ‘„๐Ÿง ๐Ÿฆพ๐Ÿฆฟ๐Ÿ‘ฃ๐Ÿคบโ›ท๐Ÿคผโ€โ™‚๏ธ๐Ÿคผโ€โ™€๏ธ๐Ÿ‘ฏโ€โ™‚๏ธ๐Ÿ‘ฏโ€โ™€๏ธ๐Ÿ’‘๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘ฉ๐Ÿ‘จโ€โค๏ธโ€๐Ÿ‘จ๐Ÿ’๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘ฉ๐Ÿ‘จโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ๐Ÿ‘ช๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ง๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ง๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ง๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง๐Ÿ‘ฉโ€๐Ÿ‘ฆ๐Ÿ‘ฉโ€๐Ÿ‘ง๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง๐Ÿ‘จโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ง๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ง๐Ÿ‘ญ๐Ÿ‘ฉ๐Ÿปโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿป๐Ÿ‘ฉ๐Ÿผโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿป๐Ÿ‘ฉ๐Ÿผโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿผ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿป๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿผ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿฝ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿผ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿฝ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿพ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿป๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿผ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿฝ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿพ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘ฉ๐Ÿฟ๐Ÿ‘ซ๐Ÿ‘ฉ๐Ÿปโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿปโ€๐Ÿคโ€๐Ÿง‘๐Ÿผ๐Ÿ‘ฉ๐Ÿปโ€๐Ÿคโ€๐Ÿง‘๐Ÿฝ๐Ÿ‘ฉ๐Ÿปโ€๐Ÿคโ€๐Ÿง‘๐Ÿพ๐Ÿ‘ฉ๐Ÿปโ€๐Ÿคโ€๐Ÿง‘๐Ÿฟ๐Ÿ‘ฉ๐Ÿผโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿผโ€๐Ÿคโ€๐Ÿง‘๐Ÿผ๐Ÿ‘ฉ๐Ÿผโ€๐Ÿคโ€๐Ÿง‘๐Ÿฝ๐Ÿ‘ฉ๐Ÿผโ€๐Ÿคโ€๐Ÿง‘๐Ÿพ๐Ÿ‘ฉ๐Ÿผโ€๐Ÿคโ€๐Ÿง‘๐Ÿฟ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿคโ€๐Ÿง‘๐Ÿผ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿคโ€๐Ÿง‘๐Ÿฝ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿคโ€๐Ÿง‘๐Ÿพ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿคโ€๐Ÿง‘๐Ÿฟ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿง‘๐Ÿผ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿง‘๐Ÿฝ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿง‘๐Ÿพ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿง‘๐Ÿฟ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿผ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿฝ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿพ๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿฟ๐Ÿ‘ฌ๐Ÿ‘จ๐Ÿปโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿป๐Ÿ‘จ๐Ÿผโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿป๐Ÿ‘จ๐Ÿผโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿผ๐Ÿ‘จ๐Ÿฝโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿป๐Ÿ‘จ๐Ÿฝโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿผ๐Ÿ‘จ๐Ÿฝโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฝ๐Ÿ‘จ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿป๐Ÿ‘จ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿผ๐Ÿ‘จ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฝ๐Ÿ‘จ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿพ๐Ÿ‘จ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿป๐Ÿ‘จ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿผ๐Ÿ‘จ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฝ๐Ÿ‘จ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿพ๐Ÿ‘จ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘จ๐Ÿฟโ€๐Ÿคโ€๐Ÿ‘จ ๐Ÿ‘ฉ๐Ÿ‘จ๐Ÿง‘๐Ÿ‘ง๐Ÿ‘ฆ๐Ÿง’๐Ÿ‘ถ๐Ÿ‘ต๐Ÿ‘ด๐Ÿง“๐Ÿ‘ฉโ€๐Ÿฆฐ๐Ÿ‘จโ€๐Ÿฆฐ๐Ÿ‘ฉโ€๐Ÿฆฑ๐Ÿ‘จโ€๐Ÿฆฑ๐Ÿ‘ฉโ€๐Ÿฆฒ๐Ÿ‘จโ€๐Ÿฆฒ๐Ÿ‘ฉโ€๐Ÿฆณ๐Ÿ‘จโ€๐Ÿฆณ๐Ÿ‘ฑโ€โ™€๏ธ๐Ÿ‘ฑโ€โ™‚๏ธ๐Ÿ‘ธ๐Ÿคด๐Ÿ‘ณโ€โ™€๏ธ๐Ÿ‘ณโ€โ™‚๏ธ๐Ÿ‘ฒ๐Ÿง”๐Ÿ‘ผ๐Ÿคถ๐ŸŽ…๐Ÿ‘ฎโ€โ™€๏ธ๐Ÿ‘ฎโ€โ™‚๏ธ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿ•ต๏ธโ€โ™‚๏ธ๐Ÿ’‚โ€โ™€๏ธ๐Ÿ’‚โ€โ™‚๏ธ๐Ÿ‘ทโ€โ™€๏ธ๐Ÿ‘ทโ€โ™‚๏ธ๐Ÿ‘ฉโ€โš•๏ธ๐Ÿ‘จโ€โš•๏ธ๐Ÿ‘ฉโ€๐ŸŽ“๐Ÿ‘จโ€๐ŸŽ“๐Ÿ‘ฉโ€๐Ÿซ๐Ÿ‘จโ€๐Ÿซ๐Ÿ‘ฉโ€โš–๏ธ๐Ÿ‘จโ€โš–๏ธ๐Ÿ‘ฉโ€๐ŸŒพ๐Ÿ‘จโ€๐ŸŒพ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ‘จโ€๐Ÿณ๐Ÿ‘ฉโ€๐Ÿ”ง๐Ÿ‘จโ€๐Ÿ”ง๐Ÿ‘ฉโ€๐Ÿญ๐Ÿ‘จโ€๐Ÿญ๐Ÿ‘ฉโ€๐Ÿ’ผ๐Ÿ‘จโ€๐Ÿ’ผ๐Ÿ‘ฉโ€๐Ÿ”ฌ๐Ÿ‘จโ€๐Ÿ”ฌ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐ŸŽค๐Ÿ‘จโ€๐ŸŽค๐Ÿ‘ฉโ€๐ŸŽจ๐Ÿ‘จโ€๐ŸŽจ๐Ÿ‘ฉโ€โœˆ๏ธ๐Ÿ‘จโ€โœˆ๏ธ๐Ÿ‘ฉโ€๐Ÿš€๐Ÿ‘จโ€๐Ÿš€๐Ÿ‘ฉโ€๐Ÿš’๐Ÿ‘จโ€๐Ÿš’๐Ÿง•๐Ÿ‘ฐ๐Ÿคต๐Ÿคฑ๐Ÿคฐ๐Ÿฆธโ€โ™€๏ธ๐Ÿฆธโ€โ™‚๏ธ๐Ÿฆนโ€โ™€๏ธ๐Ÿฆนโ€โ™‚๏ธ๐Ÿง™โ€โ™€๏ธ๐Ÿง™โ€โ™‚๏ธ๐Ÿงšโ€โ™€๏ธ๐Ÿงšโ€โ™‚๏ธ๐Ÿง›โ€โ™€๏ธ๐Ÿง›โ€โ™‚๏ธ๐Ÿงœโ€โ™€๏ธ๐Ÿงœโ€โ™‚๏ธ๐Ÿงโ€โ™€๏ธ๐Ÿงโ€โ™‚๏ธ๐ŸงŸโ€โ™€๏ธ๐ŸงŸโ€โ™‚๏ธ๐Ÿ™โ€โ™€๏ธ๐Ÿ™โ€โ™‚๏ธ๐Ÿ™Žโ€โ™€๏ธ๐Ÿ™Žโ€โ™‚๏ธ๐Ÿ™…โ€โ™€๏ธ๐Ÿ™…โ€โ™‚๏ธ๐Ÿ™†โ€โ™€๏ธ๐Ÿ™†โ€โ™‚๏ธ๐Ÿงโ€โ™€๏ธ๐Ÿงโ€โ™‚๏ธ๐Ÿ’โ€โ™€๏ธ๐Ÿ’โ€โ™‚๏ธ๐Ÿ™‹โ€โ™€๏ธ๐Ÿ™‹โ€โ™‚๏ธ๐Ÿ™‡โ€โ™€๏ธ๐Ÿ™‡โ€โ™‚๏ธ๐Ÿคฆโ€โ™€๏ธ๐Ÿคฆโ€โ™‚๏ธ๐Ÿคทโ€โ™€๏ธ๐Ÿคทโ€โ™‚๏ธ๐Ÿ’†โ€โ™€๏ธ๐Ÿ’†โ€โ™‚๏ธ๐Ÿ’‡โ€โ™€๏ธ๐Ÿ’‡โ€โ™‚๏ธ๐Ÿง–โ€โ™€๏ธ๐Ÿง–โ€โ™‚๏ธ๐Ÿคนโ€โ™€๏ธ๐Ÿคนโ€โ™‚๏ธ๐Ÿ‘ฉโ€๐Ÿฆฝ๐Ÿ‘จโ€๐Ÿฆฝ๐Ÿ‘ฉโ€๐Ÿฆผ๐Ÿ‘จโ€๐Ÿฆผ๐Ÿ‘ฉโ€๐Ÿฆฏ๐Ÿ‘จโ€๐Ÿฆฏ๐ŸงŽโ€โ™€๏ธ๐ŸงŽโ€โ™‚๏ธ๐Ÿงโ€โ™€๏ธ๐Ÿงโ€โ™‚๏ธ๐Ÿšถโ€โ™€๏ธ๐Ÿšถโ€โ™‚๏ธ๐Ÿƒโ€โ™€๏ธ๐Ÿƒโ€โ™‚๏ธ๐Ÿ’ƒ๐Ÿ•บ๐Ÿง—โ€โ™€๏ธ๐Ÿง—โ€โ™‚๏ธ๐Ÿง˜โ€โ™€๏ธ๐Ÿง˜โ€โ™‚๏ธ๐Ÿ›€๐Ÿ›Œ๐Ÿ•ด๐Ÿ‡๐Ÿ‚๐ŸŒ๏ธโ€โ™€๏ธ๐ŸŒ๏ธโ€โ™‚๏ธ๐Ÿ„โ€โ™€๏ธ๐Ÿ„โ€โ™‚๏ธ๐Ÿšฃโ€โ™€๏ธ๐Ÿšฃโ€โ™‚๏ธ๐ŸŠโ€โ™€๏ธ๐ŸŠโ€โ™‚๏ธ๐Ÿคฝโ€โ™€๏ธ๐Ÿคฝโ€โ™‚๏ธ๐Ÿคพโ€โ™€๏ธ๐Ÿคพโ€โ™‚๏ธโ›น๏ธโ€โ™€๏ธโ›น๏ธโ€โ™‚๏ธ๐Ÿ‹๏ธโ€โ™€๏ธ๐Ÿ‹๏ธโ€โ™‚๏ธ๐Ÿšดโ€โ™€๏ธ๐Ÿšดโ€โ™‚๏ธ๐Ÿšตโ€โ™€๏ธ๐Ÿšตโ€โ™‚๏ธ๐Ÿคธโ€โ™€๏ธ๐Ÿคธโ€โ™‚๏ธ๐Ÿคณ๐Ÿ’ช๐Ÿฆต๐Ÿฆถ๐Ÿ‘‚๐Ÿฆป๐Ÿ‘ƒ๐Ÿค๐Ÿ‘ˆ๐Ÿ‘‰โ˜๐Ÿ‘†๐Ÿ‘‡โœŒ๐Ÿคž๐Ÿ––๐Ÿค˜๐Ÿค™๐Ÿ–โœ‹๐Ÿ‘Œ๐Ÿ‘๐Ÿ‘ŽโœŠ๐Ÿ‘Š๐Ÿค›๐Ÿคœ๐Ÿคš๐Ÿ‘‹๐ŸคŸโœ๐Ÿ‘๐Ÿ‘๐Ÿ™Œ๐Ÿคฒ๐Ÿ™๐Ÿค๐Ÿ’… ๐ŸŽˆ๐ŸŽ†๐ŸŽ‡๐Ÿงจโœจ๐ŸŽ‰๐ŸŽŠ๐ŸŽƒ๐ŸŽ„๐ŸŽ‹๐ŸŽ๐ŸŽŽ๐ŸŽ๐ŸŽ๐ŸŽ‘๐Ÿงง๐ŸŽ€๐ŸŽ๐ŸŽ—๐ŸŽž๐ŸŽŸ๐ŸŽซ๐ŸŽ ๐ŸŽก๐ŸŽข๐ŸŽช๐ŸŽญ๐Ÿ–ผ๐ŸŽจ๐Ÿงต๐Ÿงถ๐Ÿ›’๐Ÿ‘“๐Ÿ•ถ๐Ÿฆบ๐Ÿฅฝ๐Ÿฅผ๐Ÿงฅ๐Ÿ‘”๐Ÿ‘•๐Ÿ‘–๐Ÿฉณ๐Ÿงฃ๐Ÿงค๐Ÿงฆ๐Ÿ‘—๐Ÿฅป๐Ÿ‘˜๐Ÿ‘š๐Ÿฉฒ๐Ÿฉฑ๐Ÿ‘™๐Ÿ‘›๐Ÿ‘œ๐Ÿ‘๐Ÿ›๐ŸŽ’๐Ÿ‘ž๐Ÿ‘Ÿ๐Ÿฅพ๐Ÿฅฟ๐Ÿ‘ ๐Ÿ‘ก๐Ÿ‘ข๐Ÿฉฐ๐Ÿ‘‘๐Ÿงขโ›‘๐Ÿ‘’๐ŸŽฉ๐ŸŽ“๐Ÿ’‹๐Ÿ’„๐Ÿ’๐Ÿ’Žโšฝโšพ๐ŸฅŽ๐Ÿ€๐Ÿ๐Ÿˆ๐Ÿ‰๐ŸŽฑ๐ŸŽณ๐ŸฅŒโ›ณโ›ธ๐ŸŽฃ๐Ÿคฟ๐ŸŽฝ๐Ÿ›ถ๐ŸŽฟ๐Ÿ›ท๐Ÿฅ…๐Ÿ’๐Ÿฅ๐Ÿ๐Ÿ‘๐Ÿ“๐Ÿธ๐ŸŽพ๐Ÿฅ๐Ÿช๐ŸŽฏ๐ŸฅŠ๐Ÿฅ‹๐Ÿฅ‡๐Ÿฅˆ๐Ÿฅ‰๐Ÿ…๐ŸŽ–๐Ÿ†๐ŸŽฎ๐Ÿ•น๐ŸŽฐ๐ŸŽฒ๐Ÿ”ฎ๐Ÿงฟ๐Ÿงฉ๐Ÿงธ๐Ÿช€๐ŸŽด๐Ÿƒ๐Ÿ€„โ™Ÿโ™ โ™ฃโ™ฅโ™ฆ๐Ÿ”ˆ๐Ÿ”‰๐Ÿ”Š๐Ÿ“ข๐Ÿ“ฃ๐Ÿ””๐ŸŽผ๐ŸŽต๐ŸŽถ๐ŸŽ™๐ŸŽค๐ŸŽš๐ŸŽ›๐ŸŽง๐Ÿ“ฏ๐Ÿฅ๐ŸŽท๐ŸŽบ๐ŸŽธ๐Ÿช•๐ŸŽป๐ŸŽน๐Ÿ“ป๐Ÿ”’๐Ÿ”“๐Ÿ”๐Ÿ”๐Ÿ”‘๐Ÿ—๐Ÿช“๐Ÿ”จโ›โš’๐Ÿ› ๐Ÿ”ง๐Ÿ”ฉ๐Ÿงฑโš™๐Ÿ—œ๐Ÿ›ขโš—๐Ÿงช๐Ÿงซ๐Ÿงฌ๐Ÿฉบ๐Ÿ’‰๐Ÿฉธ๐Ÿฉน๐Ÿ’Š๐Ÿ”ฌ๐Ÿ”ญโš–๐Ÿ“ฟ๐Ÿ”—โ›“๐Ÿงฐ๐Ÿงฒ๐Ÿฆฏ๐Ÿ›ก๐Ÿน๐Ÿ—กโš”๐Ÿ”ช๐Ÿ’ฃ๐Ÿ”ซโ˜Ž๐Ÿ“ž๐Ÿ“Ÿ๐Ÿ“ ๐Ÿ“ฑ๐Ÿ“ฒ๐Ÿ“ณ๐Ÿ“ด๐Ÿšฌโšฐโšฑ๐Ÿ—ฟ๐Ÿ”‹๐Ÿ”Œ๐Ÿ’ป๐Ÿ–ฅ๐Ÿ–จโŒจ๐Ÿ–ฑ๐Ÿ–ฒ๐Ÿ’ฝ๐Ÿ’พ๐Ÿ’ฟ๐Ÿ“€๐Ÿงฎ๐ŸŽฅ๐ŸŽฌ๐Ÿ“ฝ๐Ÿ“ก๐Ÿ“บ๐Ÿ“ท๐Ÿ“ธ๐Ÿ“น๐Ÿ“ผ๐Ÿ”๐Ÿ”Ž๐Ÿ•ฏ๐Ÿช”๐Ÿ’ก๐Ÿ”ฆ๐Ÿฎ๐Ÿ“”๐Ÿ“•๐Ÿ“–๐Ÿ“—๐Ÿ“˜๐Ÿ“™๐Ÿ“š๐Ÿ““๐Ÿ“’๐Ÿ“ƒ๐Ÿ“œ๐Ÿ“„๐Ÿ“‘๐Ÿ“ฐ๐Ÿ—ž๐Ÿ”–๐Ÿท๐Ÿ’ฐ๐Ÿ’ด๐Ÿ’ต๐Ÿ’ถ๐Ÿ’ท๐Ÿ’ธ๐Ÿ’ณ๐Ÿงพ๐Ÿงโœ‰๐Ÿ“ง๐Ÿ“จ๐Ÿ“ฉ๐Ÿ“ค๐Ÿ“ฅ๐Ÿ“ฆ๐Ÿ“ซ๐Ÿ“ช๐Ÿ“ฌ๐Ÿ“ญ๐Ÿ“ฎ๐Ÿ—ณโœโœ’๐Ÿ–‹๐Ÿ–Š๐Ÿ–Œ๐Ÿ–๐Ÿ“๐Ÿ—’๐Ÿ’ผ๐Ÿ“๐Ÿ“‚๐Ÿ—‚๐Ÿ“…๐Ÿ“†๐Ÿ—“๐Ÿ“‡๐Ÿ“ˆ๐Ÿ“‰๐Ÿ“Š๐Ÿ“‹๐Ÿ“Œ๐Ÿ“๐Ÿ“Ž๐Ÿ–‡๐Ÿ“๐Ÿ“โœ‚๐Ÿ—ƒ๐Ÿ—„๐Ÿ—‘โŒ›โณโŒšโฐโฑโฒ๐Ÿ•ฐ ๐Ÿ•๐Ÿ”๐ŸŸ๐ŸŒญ๐Ÿฟ๐Ÿง‚๐Ÿฅ“๐Ÿฅš๐Ÿณ๐Ÿง‡๐Ÿฅž๐Ÿงˆ๐Ÿž๐Ÿฅ๐Ÿฅจ๐Ÿฅฏ๐Ÿฅ–๐Ÿง€๐Ÿฅ—๐Ÿฅ™๐Ÿฅช๐ŸŒฎ๐ŸŒฏ๐Ÿฅซ๐Ÿ–๐Ÿ—๐Ÿฅฉ๐Ÿ ๐ŸฅŸ๐Ÿฅ ๐Ÿฅก๐Ÿฑ๐Ÿ˜๐Ÿ™๐Ÿš๐Ÿ›๐Ÿœ๐Ÿฆช๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฅฎ๐Ÿข๐Ÿง†๐Ÿฅ˜๐Ÿฒ๐Ÿ๐Ÿฅฃ๐Ÿฅง๐Ÿฆ๐Ÿง๐Ÿจ๐Ÿฉ๐Ÿช๐ŸŽ‚๐Ÿฐ๐Ÿง๐Ÿซ๐Ÿฌ๐Ÿญ๐Ÿก๐Ÿฎ๐Ÿฏ๐Ÿผ๐Ÿฅ›๐Ÿงƒโ˜•๐Ÿต๐Ÿง‰๐Ÿถ๐Ÿพ๐Ÿท๐Ÿธ๐Ÿน๐Ÿบ๐Ÿป๐Ÿฅ‚๐Ÿฅƒ๐ŸงŠ๐Ÿฅค๐Ÿฅข๐Ÿฝ๐Ÿด๐Ÿฅ„๐Ÿบ๐Ÿฅ๐Ÿฅฅ๐Ÿ‡๐Ÿˆ๐Ÿ‰๐ŸŠ๐Ÿ‹๐ŸŒ๐Ÿ๐Ÿฅญ๐ŸŽ๐Ÿ๐Ÿ๐Ÿ‘๐Ÿ’๐Ÿ“๐Ÿ…๐Ÿ†๐ŸŒฝ๐ŸŒถ๐Ÿ„๐Ÿฅ‘๐Ÿฅ’๐Ÿฅฌ๐Ÿฅฆ๐Ÿฅ”๐Ÿง„๐Ÿง…๐Ÿฅ•๐ŸŒฐ๐Ÿฅœ๐Ÿ’๐ŸŒธ๐Ÿต๐ŸŒน๐ŸŒบ๐ŸŒป๐ŸŒผ๐ŸŒท๐Ÿฅ€โ˜˜๐ŸŒฑ๐ŸŒฒ๐ŸŒณ๐ŸŒด๐ŸŒต๐ŸŒพ๐ŸŒฟ๐Ÿ€๐Ÿ๐Ÿ‚๐Ÿƒ ๐Ÿš—๐Ÿš“๐Ÿš•๐Ÿ›บ๐Ÿš™๐ŸšŒ๐Ÿš๐ŸšŽ๐Ÿš‘๐Ÿš’๐Ÿšš๐Ÿš›๐Ÿšœ๐Ÿš˜๐Ÿš”๐Ÿš–๐Ÿš๐Ÿฆฝ๐Ÿฆผ๐Ÿ›น๐Ÿšฒ๐Ÿ›ด๐Ÿ›ต๐Ÿ๐ŸŽ๐Ÿš„๐Ÿš…๐Ÿšˆ๐Ÿš๐Ÿšž๐Ÿšƒ๐Ÿš‹๐Ÿš†๐Ÿš‰๐ŸšŠ๐Ÿš‡๐ŸšŸ๐Ÿš ๐Ÿšก๐Ÿš‚๐Ÿ›ฉ๐Ÿช‚โœˆ๐Ÿ›ซ๐Ÿ›ฌ๐Ÿ’บ๐Ÿš๐Ÿš€๐Ÿ›ธ๐Ÿ›ฐโ›ต๐Ÿšค๐Ÿ›ฅโ›ด๐Ÿ›ณ๐Ÿšขโš“๐Ÿšโ›ฝ๐Ÿšจ๐Ÿšฅ๐Ÿšฆ๐Ÿšง๐Ÿ๐Ÿณโ€๐ŸŒˆ๐Ÿณ๐Ÿด๐Ÿดโ€โ˜ ๏ธ๐Ÿšฉ๐ŸŒŒ๐Ÿช๐ŸŒ๐ŸŒŽ๐ŸŒ๐Ÿ—บ๐Ÿงญ๐Ÿ”โ›ฐ๐ŸŒ‹๐Ÿ—ป๐Ÿ›ค๐Ÿ•๐Ÿž๐Ÿ›ฃ๐Ÿ–๐Ÿœ๐Ÿ๐ŸŸ๐Ÿ›๐Ÿ—๐Ÿ˜๐Ÿ™๐Ÿš๐Ÿ ๐Ÿกโ›ช๐Ÿ•‹๐Ÿ•Œ๐Ÿ›•๐Ÿ•โ›ฉ๐Ÿข๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿจ๐Ÿฉ๐Ÿช๐Ÿซ๐Ÿฌ๐Ÿญ๐Ÿฏ๐Ÿฐ๐Ÿ’’๐Ÿ—ผ๐ŸŒ‰๐Ÿ—ฝ๐Ÿ—พ๐ŸŽŒโ›ฒโ›บ๐ŸŒ๐ŸŒƒ๐ŸŒ„๐ŸŒ…๐ŸŒ†๐ŸŒ‡โ™จ๐Ÿ’ˆ๐Ÿ›Ž๐Ÿงณ๐Ÿช‘๐Ÿšช๐Ÿ›๐Ÿ›‹๐Ÿšฝ๐Ÿงป๐Ÿšฟ๐Ÿ›๐Ÿงผ๐Ÿงฝ๐Ÿงด๐Ÿช’๐Ÿงท๐Ÿงน๐Ÿงบ๐Ÿงฏโ˜โ›…โ›ˆ๐ŸŒค๐ŸŒฅ๐ŸŒฆ๐ŸŒง๐ŸŒจ๐ŸŒฉ๐ŸŒช๐ŸŒซ๐ŸŒ๐ŸŒ‘๐ŸŒ’๐ŸŒ“๐ŸŒ”๐ŸŒ•๐ŸŒ–๐ŸŒ—๐ŸŒ˜๐ŸŒ™๐ŸŒš๐ŸŒ›๐ŸŒœโ˜€๐ŸŒžโญ๐ŸŒŸ๐ŸŒ โ˜„๐ŸŒก๐ŸŒฌ๐ŸŒ€๐ŸŒˆ๐ŸŒ‚โ˜‚โ˜”โ›ฑโšกโ„โ˜ƒโ›„๐Ÿ”ฅ๐Ÿ’ง๐ŸŒŠ โค๐Ÿงก๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ๐ŸคŽ๐Ÿ–ค๐Ÿค๐Ÿ’”โฃ๐Ÿ’•๐Ÿ’ž๐Ÿ’“๐Ÿ’—๐Ÿ’–๐Ÿ’˜๐Ÿ’๐Ÿ’Ÿ๐Ÿ’Œ๐Ÿ’ข๐Ÿ’ฅ๐Ÿ’ค๐Ÿ’ฆ๐Ÿ’จ๐Ÿ’ซ๐Ÿ•ณโ˜ฎโœโ˜ช๐Ÿ•‰โ˜ธโœก๐Ÿ”ฏ๐Ÿ•Žโ˜ฏโ˜ฆ๐Ÿ›โ›Žโ™ˆโ™‰โ™Šโ™‹โ™Œโ™โ™Žโ™โ™โ™‘โ™’โ™“๐Ÿ†”โš•โ™พโš›๐Ÿˆณ๐Ÿˆน๐Ÿˆถ๐Ÿˆš๐Ÿˆธ๐Ÿˆบ๐Ÿˆทโœด๐Ÿ†š๐Ÿ‰‘๐Ÿ’ฎ๐Ÿ‰ใŠ™ใŠ—๐Ÿˆด๐Ÿˆต๐Ÿˆฒ๐Ÿšผ๐Ÿ…ฐ๐Ÿ…ฑ๐Ÿ†Ž๐Ÿ†‘๐Ÿ…พ๐Ÿ†˜โ›”๐Ÿ›‘๐Ÿ“›โŒโญ•๐Ÿšซ๐Ÿ”‡๐Ÿ”•๐Ÿšญ๐Ÿšท๐Ÿšฏ๐Ÿšณ๐Ÿšฑ๐Ÿ”ž๐Ÿ“ตโ—โ•โ“โ”โ€ผโ‰๐Ÿ’ฏ๐Ÿ”…๐Ÿ”†๐Ÿ”ฑโšœใ€ฝโ˜ขโ˜ฃโš ๐Ÿšธ๐Ÿ”ฐโ™ป๐Ÿˆฏ๐Ÿ’นโ‡โœณโŽโœ…๐Ÿ’ ๐ŸŒโ“‚๐Ÿˆ‚โžฟ๐Ÿ›‚๐Ÿ›ƒ๐Ÿ›„๐Ÿ›…โ™ฟ๐Ÿšพ๐Ÿ…ฟ๐Ÿšฐ๐Ÿšน๐Ÿšบ๐Ÿšป๐Ÿšฎ๐Ÿ“ถ๐Ÿˆ๐Ÿ†–๐Ÿ†—๐Ÿ†™๐Ÿ†’๐Ÿ†•๐Ÿ†“#๏ธโƒฃ*๏ธโƒฃ0๏ธโƒฃ1๏ธโƒฃ2๏ธโƒฃ3๏ธโƒฃ4๏ธโƒฃ5๏ธโƒฃ6๏ธโƒฃ7๏ธโƒฃ8๏ธโƒฃ9๏ธโƒฃ๐Ÿ”Ÿ๐Ÿ”ขโ–ถโธโฏโนโบโญโฎโฉโช๐Ÿ”€๐Ÿ”๐Ÿ”‚โ—€๐Ÿ”ผโซ๐Ÿ”ฝโฌโ๐ŸŽฆโžกโฌ…โฌ†โฌ‡โ†—โ†˜โ†™โ†–โ†•โ†”๐Ÿ”„โ†ชโ†ฉโคดโคตโ„น๐Ÿ”ค๐Ÿ”ก๐Ÿ” ๐Ÿ”ฃ๐Ÿ”ƒ๐Ÿ”›๐Ÿ”๐Ÿ”œโ˜‘๐Ÿ”š๐Ÿ”™ใ€ฐโžฐโœ”๐Ÿ’ฒ๐Ÿ’ฑโž•โž–โœ–โž—ยฉยฎโ„ข๐Ÿ”˜๐Ÿ”ด๐ŸŸ ๐ŸŸก๐ŸŸข๐Ÿ”ต๐ŸŸฃ๐ŸŸคโšซโšช๐ŸŸฅ๐ŸŸง๐ŸŸจ๐ŸŸฉ๐ŸŸฆ๐ŸŸช๐ŸŸซโฌ›โฌœโ—ผโ—ปโ—พโ—ฝโ–ชโ–ซ๐Ÿ”ถ๐Ÿ”ธ๐Ÿ”ท๐Ÿ”น๐Ÿ”บ๐Ÿ”ป๐Ÿ”ฒ๐Ÿ”ณ๐Ÿ’ญ๐Ÿ—ฏ๐Ÿ’ฌ๐Ÿ—จ๐Ÿ‘โ€๐Ÿ—จ๐Ÿ•๐Ÿ•‘๐Ÿ•’๐Ÿ•“๐Ÿ•”๐Ÿ••๐Ÿ•–๐Ÿ•—๐Ÿ•˜๐Ÿ•™๐Ÿ•š๐Ÿ•›๐Ÿ•œ๐Ÿ•๐Ÿ•ž๐Ÿ•Ÿ๐Ÿ• ๐Ÿ•ก๐Ÿ•ข๐Ÿ•ฃ๐Ÿ•ค๐Ÿ•ฅ๐Ÿ•ฆ๐Ÿ•ง ;-)ยฏ\_(ใƒ„)_/ยฏ( โ€ข_โ€ข)>โŒโ– -โ– (โŒโ– _โ– ):-P:-((โ€ข_โ€ข)( ยด๏ฝฅ๏ฝฅ)๏พ‰(._.`)เผผ ใค โ—•_โ—• เผฝใค(ห‰๏นƒห‰)(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ปเฒ _เฒ เฒฅ_เฒฅ:-Dแ“šแ˜แ—ข(โ”ฌโ”ฌ๏นโ”ฌโ”ฌ)^_^:-)(^///^)โ•ฐ(*ยฐโ–ฝยฐ*)โ•ฏโ˜†*: .๏ฝก. o(โ‰งโ–ฝโ‰ฆ)o .๏ฝก.:*โ˜†(*/ฯ‰๏ผผ*)(โ—'โ—ก'โ—)(โยดโ—ก`โ)(โ˜ž๏พŸใƒฎ๏พŸ)โ˜žโ˜œ(๏พŸใƒฎ๏พŸโ˜œ)(ยฌโ€ฟยฌ)(ยฌ_ยฌ )(T_T)(โŠ™_โŠ™;) ๐Ÿ˜ is ["\uD83D\uDE01"](https://www.fileformat.info/info/unicode/char/1f601/index.htm), or 0n55357, 0n56833
OutputCellView OutputCellIterator::s_GenerateView(const std::wstring_view view,
                                                  const TextAttribute attr,
                                                  const TextAttributeBehavior behavior)
{
    const auto glyph = Utf16Parser::ParseNext(view);
    DbcsAttribute dbcsAttr;
    if (IsGlyphFullWidth(glyph))
    {
        dbcsAttr.SetLeading();
    }

    return OutputCellView(glyph, dbcsAttr, attr, behavior);
}

As the two wchar_ts get written to the buffer by WriteCharsLegacy, we create an OutputCellIterator to write each half of the emoji. Unfortunately, we write each half one char at a time. Utf16Parser::ParseNext doesn't like that. It knows the first wchar_t is a leading byte, but can also tell there's no trailing byte, so it just returns a Replacement char.

The character does end up getting inserted into the cooked read data correctly, which is why hitting enter to submit the commandline in cmd works just fine. The data in the cooked read data is correct, but the text buffer has the wrong data.

Presumably, the cooked read is just writing the text buffer wrong. COOKED_READ_DATA::ProcessInput can only handle one wchar_t at a time.

When you use the emoji picker to input the character, it first comes through ConversionAreaInfo::WriteText straight to _screenBuffer->Write to draw the composition buffer. Then, once the dialog is dismissed, the keys get sent to the input buffer in ConsoleImeInfo::_InsertConvertedString, where again the cooked read gets them one char at a time to display broken in the buffer.


EDIT: March 30th 2020

I've investigated into this a bit, and this is one of those terrible rabbit-hole issues. Even if we do add support for simply typing/pasting emoji to COOKED_READ, that opens up a whole other can of bugs. Then, COOKED_READ should probably also be enlightened to support backspacing an emoji. Also, what happens for applications that are expecting UCS-2 input, not utf-16? It's an unfortunately complex issue that we'll have to resolve on the console side of things.

This is now the "COOKED_READ (cmd.exe) doesn't properly support emoji input" issue, and I'm moving this to 21H1 as a "Feature", so we can try and prioritize for the next Windows release.

Code Snippet for future developers I found that I could get cooked read to draw the emoji right every time by re-printing the buffer each time, but that wouldn't work for backspacing through emoji. Take a look at this segment for code for `COOKED_READ_DATA::ProcessInput` ```c++ if (AtEol()) { // If at end of line, processing is relatively simple. Just store the character and write it to the screen. if (wch == UNICODE_BACKSPACE2) { wch = UNICODE_BACKSPACE; } if (wch != UNICODE_BACKSPACE || _bufPtr != _backupLimit) { fStartFromDelim = IsWordDelim(_bufPtr[-1]); bool loop = true; while (loop) { loop = false; if (wch == UNICODE_BACKSPACE && _processedInput) { _bufPtr -= 1; // clang-format off #pragma prefast(suppress: __WARNING_POTENTIAL_BUFFER_OVERFLOW_HIGH_PRIORITY, "This access is fine") // clang-format on *_bufPtr = (WCHAR)' '; _currentPosition -= 1; _screenInfo.GetTextBuffer().GetCursor().SetPosition(_originalCursorPosition); status = WriteCharsLegacy(_screenInfo, _backupLimit, _backupLimit, _backupLimit, &_bytesRead, &NumSpaces, _originalCursorPosition.X, WC_DESTRUCTIVE_BACKSPACE | WC_KEEP_CURSOR_VISIBLE | WC_ECHO, &ScrollY); _bytesRead -= sizeof(WCHAR); // Repeat until it hits the word boundary if (wchOrig == EXTKEY_ERASE_PREV_WORD && _bufPtr != _backupLimit && fStartFromDelim ^ !IsWordDelim(_bufPtr[-1])) { loop = true; } } else { *_bufPtr = wch; _bytesRead += sizeof(WCHAR); _bufPtr += 1; _currentPosition += 1; } if (_echoInput) { NumToWrite = sizeof(WCHAR); _screenInfo.GetTextBuffer().GetCursor().SetPosition(_originalCursorPosition); status = WriteCharsLegacy(_screenInfo, _backupLimit, _backupLimit, _backupLimit, &_bytesRead, &NumSpaces, _originalCursorPosition.X, WC_DESTRUCTIVE_BACKSPACE | WC_KEEP_CURSOR_VISIBLE | WC_ECHO, &ScrollY); if (NT_SUCCESS(status)) { _originalCursorPosition.Y += ScrollY; } else { RIPMSG1(RIP_WARNING, "WriteCharsLegacy failed %x", status); } } // if (wch == UNICODE_BACKSPACE && _processedInput) // { // _bytesRead -= sizeof(WCHAR); // } _visibleCharCount += NumSpaces; } } } else ```