https://github.com/maximus5/ms-bug-2
Broken text in console input buffer
https://github.com/maximus5/ms-bug-2
Last synced: 3 months ago
JSON representation
Broken text in console input buffer
- Host: GitHub
- URL: https://github.com/maximus5/ms-bug-2
- Owner: Maximus5
- Created: 2016-07-07T15:45:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-07T16:16:54.000Z (over 9 years ago)
- Last Synced: 2025-01-31T11:50:16.827Z (12 months ago)
- Language: C++
- Size: 50.8 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# conhost console input bug
Some console applications use `ReadFile` WinApi function or its wrappers.
The problem is that when console **input** buffer is filled by `WriteConsoleInput` with ‘long’ strings (e.g. URL-s, code snippets, etc.), `ReadFile` returns broken data.
This sample application illustrates the problem.
It writes 65-chars long string into console input buffer in one thread and read input buffer in the another thread.
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ|||
If your Windows has this bug, you'll see `?` or some other errors instead or inside characters of the expected string.
These error characters are highlighted - black text on red background.

### References
* https://github.com/Maximus5/issues/760
* https://github.com/Maximus5/conemu-old-issues/issues/903