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

winpty-agent.exe crashes when running Far Manager and resizing terminal #30

Open
aleherb opened this issue Jul 24, 2015 · 4 comments
Open
Labels

Comments

@aleherb
Copy link

aleherb commented Jul 24, 2015

When running Far Manager (http://www.farmanager.com/) under control of winpty, increasing the vertical terminal size (e.g. mintty) crashes winpty_agent.exe due to an assertion failure:

Assertion failed: bufferRect.contains(newWindowRect), file Win32Console.cc, line 222

The reason seems to be that Far Manager changes the console buffer size to the window size, which winpty cannot handle properly.

@aleherb aleherb changed the title winpty_agent.exe crashes when running Far Manager and resizing terminal winpty-agent.exe crashes when running Far Manager and resizing terminal Aug 4, 2015
@rprichard
Copy link
Owner

Yeah, winpty doesn't currently handle programs that change the window/buffer sizes. I think this can be fixed.

@rprichard
Copy link
Owner

I have some experimental changes to winpty that detect when the console buffer is resized and switches to a different mode that makes no effort to track scrolling. These changes fix the crashing.

Unfortunately, opening Far Manager under winpty in Windows 10 intermittently hangs conhost.exe. (It's the same underlying issue as #31). Strictly speaking, this is a Windows bug, not that it matters to winpty users. If you have Windows 10, you can see the problem easily:

  • (For practical reasons: Make sure you can begin text selection in the console with a simple left-click-and-drag -- no right-clicking.)
  • In a console, run "C:\Program Files\Far Manager\Far.exe"
  • Immediately, before Far Manager can start, click-and-drag to begin selection.

At this point, the console window becomes non-responsive, and Far Manager does not appear. Closing the console window isn't possible -- to clean up, conhost.exe must be killed from the Task Manager.

winpty hits this hang because it's using selection to momentarily freeze console output while it scrapes. It needs to freeze console output so it gets a consistent view of the console buffer content. It can't read the whole buffer at once, because reads are limited to something like 30KB. (In older versions of Windows, anyway. Maybe that's changed in Windows 10...)

@rprichard
Copy link
Owner

The original complaint should be fixed by d464089. Resizing the terminal no longer crashes winpty.

Starting and stopping Far Manager can hang conhost.exe in Windows 10, though, so I'll leave this issue open for now. A workaround is to enable legacy mode.

@rprichard rprichard added the bug label Oct 14, 2015
@rprichard
Copy link
Owner

IIRC, newer releases of Windows 10 fix the conhost.exe hang.

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

2 participants