Skip to content

Disabling "Quick Edit Mode" in Windows #209

@moranbw

Description

@moranbw

I have written a CLI application for Windows using the console family of libraries, also using dialoguer and indicatif. I kept running into an issue with some of my users, where the application would seemingly "freeze", but would "wake up" upon keypress (specifically ENTER). I originally though this was just the computer falling asleep, but on further review there is actually a well-known issue with "Quick Edit Mode" in Windows terminals:

In my application I have disabled it:

    unsafe {
        let input_handle = GetStdHandle(STD_INPUT_HANDLE);
        let mut mode: CONSOLE_MODE = 0;
        if GetConsoleMode(input_handle, &mut mode) != 0 {
            mode &= !ENABLE_QUICK_EDIT_MODE;
            mode |= ENABLE_EXTENDED_FLAGS;
            SetConsoleMode(input_handle, mode);
        }
    }

We seem to be doing some ConsoleMode manipulation already in windows_term/mod.rs...but it probably does not make sense to disable this behavior by default (some users may want the click and drag functionality that Quick Edit Mode provides).

But maybe it could somehow be an option when creating your Term? Or perhaps a note in the docs....or maybe the existence of this opened issue will be enough if anyone else runs into this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions