Skip to content

Commit

Permalink
console : fix issue related to Windows 11 PowerShell console mode per…
Browse files Browse the repository at this point in the history
…sistence (#2521)
  • Loading branch information
DannyDaemonic authored Aug 6, 2023
1 parent 2e8265a commit 86c3219
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ namespace console {
// Set console input codepage to UTF16
_setmode(_fileno(stdin), _O_WTEXT);

if (!simple_io) {
// Turn off ICANON (ENABLE_LINE_INPUT) and ECHO (ENABLE_ECHO_INPUT)
// Set ICANON (ENABLE_LINE_INPUT) and ECHO (ENABLE_ECHO_INPUT)
if (simple_io) {
dwMode |= ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT;
} else {
dwMode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT);
}
if (!SetConsoleMode(hConIn, dwMode)) {
Expand Down

0 comments on commit 86c3219

Please sign in to comment.