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

High CPU usage on Windows 10 non-legacy mode, related to Select All freeze method #53

Closed
rprichard opened this issue Oct 16, 2015 · 1 comment

Comments

@rprichard
Copy link
Owner

I notice about a 10-12% idle CPU consumption in my Windows 10 VM, non-legacy mode, once the 3000-line screen buffer has filled up. It appears to result from winpty's use of "Select All" to freeze console output.

I suspect it can be fixed by using "Mark" instead of "Select All". winpty used to use Mark, but it had the side-effect of temporarily moving the cursor to the top-left, which IIRC broke some Cygwin programs. (The program was probably reading the cursor position.) The new Mark behavior doesn't appear to do this, though, so maybe it will be OK.

If not, the WinEvents API should help. (#46)

rprichard added a commit that referenced this issue Jun 7, 2016
Additionally, if it is impossible to fit the entire screen buffer on the
current monitor, detect this condition uising the
GetLargestConsoleWindowSize API and make the console window as large as
possible.  This is suboptimal for full-screen console programs (e.g. Far
Manager), but because the scrolling-mode scraper scrapes the screen buffer
rather than the visble window, the smaller-than-desired window frequently
has no noticeable effect.

Revert the use of MARK to freeze the new Windows 10 console.  Use
SELECT_ALL again.

Fixes #61
Fixes #79
Breaks #53 again
rprichard added a commit that referenced this issue Jun 7, 2016
Additionally, if it is impossible to fit the entire screen buffer on the
current monitor, detect this condition uising the
GetLargestConsoleWindowSize API and make the console window as large as
possible.  This is suboptimal for full-screen console programs (e.g. Far
Manager), but because the scrolling-mode scraper scrapes the screen buffer
rather than the visble window, the smaller-than-desired window frequently
has no noticeable effect.

Revert the use of MARK to freeze the new Windows 10 console.  Use
SELECT_ALL again.

Fixes #61
Fixes #79
Breaks #53 again
@rprichard
Copy link
Owner Author

Using Mark didn't actually work -- it interfered with the cursor position and could result in garbage on the screen. While I was working on automatic font resizing, it was convenient to revert this fix, so this issue is open again on the master branch.

@rprichard rprichard reopened this Jun 7, 2016
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