cygwin 3.3.4-2: "GetConsoleMode()" may be missing "Quick Edit Mode", "Insert Mode" state

Mitchell Hentges
Tue Feb 1 22:27:55 GMT 2022

This issue only manifests when using Windows Command Prompt as the terminal
instead of MinTTY.

When querying Windows for "GetConsoleMode()" of the input handle, a result
of 0x0007 is returned.
When calling "GetConsoleMode()" from a Command Prompt (outside of Cygwin),
0x00F7 is returned.

In both these cases (on my machine), if I right-click the title bar, and
click on Properties, I can see that "Quick Edit Mode" and "Insert Mode" are
both checked. So, in both of them, I'd expect that at least the bits at 0x0040
and 0x0020 <>
respectively will be enabled.

To reproduce this:
1. Compile the following program ("cl <main.c>") to print the console mode:
#include <windows.h>

int main(void)
    HANDLE pdc_con_in = GetStdHandle(STD_INPUT_HANDLE);
    DWORD mode;
    GetConsoleMode(pdc_con_in, &mode);
    printf("Console mode: %04X", mode);
2. Run cygwin using "Cygwin.bat"
3. Run the program that prints the console mode
4. Verify the console modes in your Command Prompt properties dialog.

This is causing issues such as fzf not being able to reset the console mode
properly <>.

Mitchell Hentges
Engineering Workflow
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 15584 bytes
Desc: not available
URL: <>

More information about the Cygwin mailing list