-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
Wezterm pauses task/command execution when hidden into scratchpad (minimized?) #884
Comments
I can't reproduce this; can you try the nightly build? |
Hi @wez . I removed stable version and installed nightly version(20210619-130117-d317f0f3). Result the same. After ~10 minutes in scratchpad it paused and resume again after showing scratchpad. |
Does it have to be in the scratchpad for 10 minutes before the pause occurs? |
Yes, all this time it was hidden in scratchpad |
I managed to reproduce this: wezterm is waiting for the wayland server to respond, but the wayland EGL implementation has decided to block forever while waiting for that response:
This thread is also responsible to acting on the data that is read from the shell output. As there is back-pressure between these two threads, the shell eventually fills up the kernel buffer and the AFAICT, the root cause is the wayland server not responding. This is compounded by the EGL implementation deciding to block forever inside the buffer swap routine. These two things aren't directly under the control of wezterm, so I'm not sure that there is a lot that I can do to mitigate this. |
Thank you @wez for investigation. Would it help if I open an issue in sway about this behavior? |
Yeah, I think it would be good to get some feedback on what's going on and how applications are supposed to respond in this situation! |
According to @emersion
|
Let me know if you have questions. If you can't listen to these events to know when to render, some workarounds are being discussed in this Mesa issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4932 |
Hi @wez any news about this issue? |
No news; I understand broadly what needs to happen, but since I don't often use wayland and I don't use sway this hasn't been top of my mind. If you, or someone else, is motivated to try a PR for this, the gist of it is that:
An alternative approach that might be easier to wrangle: one of the existing callbacks receives the set of window states (eg: maximization, minimization) in You could try starting wezterm using |
So I run latest wezterm-nightly using your command for ~15 minutes and got this result
|
https://emersion.fr/blog/2018/wayland-rendering-loop/ suggests that it is best practice to do this so that the compositor doesn't cause an application to block forever if the window is moved to an off-screen state. That article also suggests using the frame callback to schedule paints; this commit has that code included, but I've left it disabled because it causes us to repaint at the monitor refresh rate which is often more frequently than we would anyway; in our problem scenario we're painting once per second and we just want to make sure that that doesn't block. So hopefully this makes the sway/scratchpad experience better! refs: #884
AFAICT, this is now resolved in main and should show up in the nightly downloads in ~10 minutes from now |
This commit ties our invalidation requests together with the surface frame callback request so that we can throttle our frame rate if we're busy, but still remain largely idle if we're not changing any content. refs: #884
I can confirm - nightly works fine. Thank you very much! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Describe the bug
When I hide scratchpad with wezterm it pause task execution.
For example.
So wezterm paused command execution on
2021-06-18T13:46:44 CEST
and continue on2021-06-18T14:17:27 CEST
Environment (please complete the following information):
zsh
wezterm 20210502-154244-3f7122cb
ENG
To Reproduce
I emulate quake like behavior with sway build-in scratchpad. One keybinding toggle show/hide scratchpad, so terminal shows only if it's necessary. I test alacritty and tilix on the same scratchpad and they both works as expected, so issue is not on sway side.
Configuration
Config file could be found here
Expected behavior
Command/task execution never paused, until I do it manually.
The text was updated successfully, but these errors were encountered: