console-rs / console-rs/console

Disabling "Quick Edit Mode" in Windows

Open
#209 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
144
Avg merge
8h 24m
Merged PRs (30d)
4

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in windows_term/mod.rs, where ConsoleMode manipulation already exists, and trace how Term is created. Review the reported Windows Quick Edit Mode behavior and determine whether the intended outcome is a Term option or documentation. Done requires one agreed approach that addresses the freeze behavior without assuming Quick Edit Mode should always be disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.