diff options
author | DannyDaemonic <DannyDaemonic@gmail.com> | 2023-08-05 23:49:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-06 09:49:34 +0300 |
commit | 86c32198954a2bc482025703d6875e11f1c2a574 (patch) | |
tree | e56556986462fa7b5ae4c8c825b560076ab15e46 | |
parent | 2e8265ae1764d6288aab0e2df641909072e2d58e (diff) |
console : fix issue related to Windows 11 PowerShell console mode persistence (#2521)
-rw-r--r-- | examples/console.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/console.cpp b/examples/console.cpp index 4c32f3b..8966b10 100644 --- a/examples/console.cpp +++ b/examples/console.cpp @@ -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)) { |