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

Using Mark interferes with cursor positioning #79

Closed
rprichard opened this issue May 27, 2016 · 1 comment
Closed

Using Mark interferes with cursor positioning #79

rprichard opened this issue May 27, 2016 · 1 comment
Labels

Comments

@rprichard
Copy link
Owner

The fix for #53 switched the "freeze" technique from SelectAll to Mark for the new Windows 10 console. The rationale was that Mark didn't move the cursor in that mode, making it acceptable.

Unfortunately, it still does interfere in a way -- when the Mark command ends, the cursor is restored to its pre-Mark position, even if it has been moved in the meantime. This is causing noticeable problems in PowerShell and cmd.exe.

PowerShell:

When pressing Return, sometimes the prompt duplicates like this:

PS C:\rprichard\proj\winpty>
PS C:\rprichard\proj\winpty> PS C:\rprichard\proj\winpty>
PS C:\rprichard\proj\winpty> PS C:\rprichard\proj\winpty>

cmd.exe:

When tab completing choices, sometimes the line has junk at the end:

C:\>cd Intel ntel

Here's a test script useful for demonstrating the problem. Build misc/SetCursorPos.exe, then run the batch file, then start Mark or SelectAll:

@echo off
cls
echo 123
echo 123
echo 123
echo 123
echo 123
echo 123
ping -n 4 127.0.0.1 >NUL
SetCursorPos 0 0
ping -n 4 127.0.0.1 >NUL
@rprichard rprichard added the bug label May 27, 2016
@rprichard
Copy link
Owner Author

This bug was introduced in ce2d9f1, and it affects 0.2.0 and newer.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant