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

Mitchell Hentges mhentges@mozilla.com
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 <https://docs.microsoft.com/en-us/windows/console/getconsolemode>
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 <https://github.com/junegunn/fzf/issues/2679>.



-- 
Mitchell Hentges
Engineering Workflow
Mozilla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 15584 bytes
Desc: not available
URL: <https://cygwin.com/pipermail/cygwin/attachments/20220201/fb8c7813/attachment-0001.obj>


More information about the Cygwin mailing list