-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
WinEvents and ConPTY question #1811
Comments
Hey, it's really funny that you should mention this. I'm working on filing a bug on them for this exact issue, because their winevent hook degrades performance for all console workloads by a few percentage points if a libuv thing is running whatsoever. I believe that WinEvents are not part of the compatibility guarantee for pseudoconsoles. @miniksa can keep me honest here. |
More info: #410 @parkovski |
Correct. Given that UIA (released 2005) is the replacement for WinEvents/MSAA (released 1997) and UIA is significantly less terrible than MSAA performance-wise (and otherwise), we didn't consider it during the implementation of ConPTY (2018). Also, MSAA and UIA are for accessibility tools and user interface testing. I don't guarantee anything if you're not attempting to use them for those purposes. |
I'm marking this one as answered and closing it. I'll follow up with the libuv bug. 😄 |
Continuing improvement of SIGWINCH from PR libuv#2308. Running SetWinEventHook without filtering for the specific PIDs has significant impact on the performance of the entire system. This PR changes the way SIGWINCH is handled. The SetWinEventHook callback now signals a separate thread, uv__tty_console_resize_watcher_thread. This thread calls uv__tty_console_signal_resize() which checks if the console was actually resized. The uv__tty_console_resize_watcher_thread makes sure to not to call the uv__tty_console_signal_resize function more than 30 times per second. The SetWinEventHook will not be installed, if the PID of the conhost.exe process that owns the console window cannot be determinated. This can happen when a 32bit libuv app is running on a 64bit Windows. For such cases PR libuv#1408 is partially reverted - when tty reads WINDOW_BUFFER_SIZE_EVENT, it will also trigger a call to uv__tty_console_signal_resize(). This will also help when the app is running under console emulators. Documentation was alos updated to reflect that. Refs: microsoft/terminal#1811 Refs: microsoft/terminal#410 Refs: libuv#2308
Continuing improvement of SIGWINCH from PR libuv#2308. Running SetWinEventHook without filtering for the specific PIDs has significant impact on the performance of the entire system. This PR changes the way SIGWINCH is handled. The SetWinEventHook callback now signals a separate thread, uv__tty_console_resize_watcher_thread. This thread calls uv__tty_console_signal_resize() which checks if the console was actually resized. The uv__tty_console_resize_watcher_thread makes sure to not to call the uv__tty_console_signal_resize function more than 30 times per second. The SetWinEventHook will not be installed, if the PID of the conhost.exe process that owns the console window cannot be determinated. This can happen when a 32bit libuv app is running on a 64bit Windows. For such cases PR libuv#1408 is partially reverted - when tty reads WINDOW_BUFFER_SIZE_EVENT, it will also trigger a call to uv__tty_console_signal_resize(). This will also help when the app is running under console emulators. Documentation was alos updated to reflect that. Refs: microsoft/terminal#1811 Refs: microsoft/terminal#410 Refs: libuv#2308
Continuing improvement of SIGWINCH from PR #2308. Running SetWinEventHook without filtering for the specific PIDs has significant impact on the performance of the entire system. This PR changes the way SIGWINCH is handled. The SetWinEventHook callback now signals a separate thread, uv__tty_console_resize_watcher_thread. This thread calls uv__tty_console_signal_resize() which checks if the console was actually resized. The uv__tty_console_resize_watcher_thread makes sure to not to call the uv__tty_console_signal_resize function more than 30 times per second. The SetWinEventHook will not be installed, if the PID of the conhost.exe process that owns the console window cannot be determinated. This can happen when a 32bit libuv app is running on a 64bit Windows. For such cases PR #1408 is partially reverted - when tty reads WINDOW_BUFFER_SIZE_EVENT, it will also trigger a call to uv__tty_console_signal_resize(). This will also help when the app is running under console emulators. Documentation was also updated to reflect that. Refs: microsoft/terminal#1811 Refs: microsoft/terminal#410 Refs: #2308 PR-URL: #2381 Reviewed-By: Ben Noordhuis <[email protected]>
A few days ago I noticed that NeoVim in tmux does not pick up resize events properly, but mysteriously when a different console window is resized, it suddenly fixes itself. I just tracked this down to the fact that libuv is listening for the EVENT_CONSOLE_LAYOUT WinEvent for any window, which doesn't seem to be firing for PTY layout changes.
Now, I believe this is a libuv bug and they should be handling
WINDOW_BUFFER_SIZE_EVENT
. But before ConPTY existed, their way did work.Basically I'm looking for some clarification here - what are the console WinEvents supposed to be for, and should they be enabled for PTYs as well? And if not, it might be a good idea to document that they are only sent for actual conhost windows.
The text was updated successfully, but these errors were encountered: