microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.27k stars 8.27k forks source link

Custom priority for process openconsole.exe and profile app #16826

Closed Zeroes1 closed 7 months ago

Zeroes1 commented 7 months ago

Wish: I want new option - set to my profile app and openconsole.exe (child of windowsterminal.exe) ran with my priority (not normal, for example - high)

why need? when run high load cpu processes I can't normal work in console mode app (for example Far manager)

zadjii-msft commented 7 months ago

I could have swore we had a dupe for this somewhere on the backlog... but I can't seem to find it now.

There's gotta be a thread somewhere about running all of the processes in a pane in a job object...

pojith commented 7 months ago

It sounds like you want to create a new option in your profile app that sets the priority of the openconsole.exe process (a child of windowsterminal.exe) to a higher priority, such as "high." This would help improve the performance of console mode applications like Far Manager when there is a high load on the CPU.

Here is a basic outline of the steps you might take to implement this:

  1. Identify openconsole.exe: Make sure you have the correct process name (openconsole.exe) and understand its relationship with windowsterminal.exe.

  2. Change Process Priority: Use a method to change the priority of the process. You can use a programming language like C# or Python to interact with the Windows API and set the priority.

    For example, in C# using System.Diagnostics:

    using System.Diagnostics;
    
    class Program
    {
        static void Main()
        {
            Process[] processes = Process.GetProcessesByName("openconsole");
    
            foreach (Process process in processes)
            {
                // Set the priority to High
                process.PriorityClass = ProcessPriorityClass.High;
            }
        }
    }

    Please note that modifying process priority should be done carefully, as setting it too high might affect the overall system performance.

  3. Integrate with your Profile App: Add an option or button in your profile app's interface to trigger the process priority change. This might involve executing a script or calling a function that changes the priority when the user selects this option.

  4. Testing: Thoroughly test the changes to ensure that the priority adjustment works as expected and doesn't negatively impact the system's stability.

Remember to check your application's licensing and ensure that modifying process priorities is within the acceptable use of your tools. Additionally, users should be informed about the potential consequences of modifying process priorities and use such features responsibly.

its it work?

Zeroes1 commented 7 months ago

it's AI help? :) I think devellopers of know how to this make....

pojith commented 7 months ago

yes bro i don't know how to solve this problem . i just begginer to this typenew kind of the issues

carlos-zamora commented 7 months ago

Thanks for the request. This work is out of scope for us, thus closing.

pojith commented 7 months ago

ko sir