Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling "Quick Edit Mode" in Windows #209

Open
moranbw opened this issue Mar 15, 2024 · 0 comments
Open

Disabling "Quick Edit Mode" in Windows #209

moranbw opened this issue Mar 15, 2024 · 0 comments

Comments

@moranbw
Copy link

moranbw commented Mar 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant