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

SetProcessWindowStation call in winpty.dll is not thread-safe and breaks clipboard #58

Closed
rprichard opened this issue Dec 20, 2015 · 3 comments

Comments

@rprichard
Copy link
Owner

winpty.dll uses SetProcessWindowStation to help put a console into the background. This call could conflict with what other threads are doing, including those starting other winpty instances.

I'm not sure what can be done about this, if anything. It might be the winpty.dll client's responsibility to deal with the consequences.

@rprichard
Copy link
Owner Author

My current plan for this issue is to disable background desktop creation for Windows 7 and up, where it seems to be unneeded, then use a special winpty-agent.exe invocation for XP/Vista that creates the background desktop and passes its name back to winpty.dll. winpty.dll would then start the agent with a STARTUPINFO.lpDesktop referring to the background desktop.

@rprichard
Copy link
Owner Author

@rprichard rprichard changed the title Thread-safety issue: SetProcessWindowStation calls in winpty.dll SetProcessWindowStation call in winpty.dll is not thread-safe and breaks clipboard Mar 28, 2016
rprichard added a commit that referenced this issue Apr 10, 2016
The SW_HIDE change fixes part of a ConEmu<->winpty incompatibility.  If
WINPTY_SHOW_CONSOLE=1 is set, and ConEmu's "start cmd" flag is on, then
readFontTable can still run forever.

Avoiding a background desktop would fix a ConEmu<->winpty incompatibility
if not for the previous fix.  It fixes a clipboard issue and
thread-unsafety issue, but only on Win7 and up.  (More work is needed for
XP/Vista.)

See #58.
See #70.
@rprichard
Copy link
Owner Author

I checked in a commit that fixes this issue, but only on Windows 7 and up.

I'll keep it open for XP and Vista.

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