Skip to content

nice, Windows: support mapping current Priority Class #14484

Open

Description

@oech3

While setting Priority Class is supported and Priority Class is mapped like

#[cfg(windows)]
let priority_class = match new_niceness {
..=-20 => REALTIME_PRIORITY_CLASS,
-19 => HIGH_PRIORITY_CLASS,
-18..=-1 => ABOVE_NORMAL_PRIORITY_CLASS,
0 => NORMAL_PRIORITY_CLASS,
1..=18 => BELOW_NORMAL_PRIORITY_CLASS,
19.. => IDLE_PRIORITY_CLASS,
};

. showing (mapping) current Priority Class is not supported:
#[cfg(not(unix))]
let current_niceness = 0i32; // todo: what we can do?

It would be better to be compatible with Cygwin's nice command.
Also, nice should show raw Priority Class e.g. instead of value if it is not a mapped class.
ref: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setpriorityclass

Activity

  1. added 3 commits that reference this issue on Sep 29, 2026
    f570015
    161fc32
    3fa1ed5
  2. added a commit that references this issue on Nov 15, 2026
    aa9a4c5
  3. added a commit that references this issue on Nov 20, 2026
    0691c78
  4. added 2 commits that reference this issue on Nov 20, 2026
    8e26818
    bc73b64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions