Taskbar action handling is slow in 1.25 #23657

Closed
opened 2026-01-31 08:48:25 +00:00 by claunia · 4 comments
Owner

Originally created by @alabuzhev on GitHub (Sep 29, 2025).

Windows Terminal version

1.25.250925001-llm

Windows build number

10.0.19045.6218

Other Software

No response

Steps to reproduce

  1. Compile this simple program:
#include <iostream>
#include <string>

#include <windows.h>

int main()
{
	for (;;)
	{
		std::cout << "Press Enter" << std::endl;

		std::string s;
		std::getline(std::cin, s);

		std::cout << "\u001b]9;4;3\u001b\\" << std::flush;

		Sleep(10);

		std::cout << "\u001b]9;4;0\u001b\\" << std::flush;
	}
}
  1. Run it in WT
  2. Press Enter a few dozen times

Expected Behavior

The program uses taskbar state:
05a4afcf35/src/terminal/adapter/adaptDispatch.cpp (L3522)
to indicate that it is doing something.
The busy period is generally unknown: it can be tens of seconds or a few milliseconds.
The program first sets the state to "indeterminate", then resets it once the work is done.
The code above simulates such a work with a short delay of 10 (or so) ms.
The overall expectation is that in cases when the delay between 'set' and 'reset' actions is short enough, it should be (more or less) invisible to the user, because we apes are way, way slower than machines and cannot notice such minute events with the naked eye.

Actual Behavior

It was (more or less) invisible until recently:

WT 1.24.1901.0:

https://github.com/user-attachments/assets/e82fcf45-3a79-4480-acd6-b1406ad4b64c

Now it takes about 0.5 s at least:

WT 1.25.2371.0:

https://github.com/user-attachments/assets/068687aa-ebb9-4998-bbf5-2241b75f8ad3

Unfortunately I don't have binaries between 1.24.1901.0 and 1.25.2371.0 to pinpoint it more precisely.

The real world scenario: run Far in WT, visit a few directories. Every time you enter or exit a directory the tab icon disappears for about 0.5 s to show the progress circle, even though the directory listing finishes much faster than that, which is annoying.

Originally created by @alabuzhev on GitHub (Sep 29, 2025). ### Windows Terminal version 1.25.250925001-llm ### Windows build number 10.0.19045.6218 ### Other Software _No response_ ### Steps to reproduce 1. Compile this simple program: ```C++ #include <iostream> #include <string> #include <windows.h> int main() { for (;;) { std::cout << "Press Enter" << std::endl; std::string s; std::getline(std::cin, s); std::cout << "\u001b]9;4;3\u001b\\" << std::flush; Sleep(10); std::cout << "\u001b]9;4;0\u001b\\" << std::flush; } } ``` 2. Run it in WT 3. Press Enter a few dozen times ### Expected Behavior The program uses taskbar state: https://github.com/microsoft/terminal/blob/05a4afcf35ab287f0a72015d162067a66973e311/src/terminal/adapter/adaptDispatch.cpp#L3522 to indicate that it is doing something. The busy period is generally unknown: it can be tens of seconds or a few milliseconds. The program first sets the state to "indeterminate", then resets it once the work is done. The code above simulates such a work with a short delay of 10 (or so) ms. The overall expectation is that in cases when the delay between 'set' and 'reset' actions is short enough, it should be (more or less) invisible to the user, because we apes are way, way slower than machines and cannot notice such minute events with the naked eye. ### Actual Behavior It was (more or less) invisible until recently: WT 1.24.1901.0: https://github.com/user-attachments/assets/e82fcf45-3a79-4480-acd6-b1406ad4b64c Now it takes about 0.5 s at least: WT 1.25.2371.0: https://github.com/user-attachments/assets/068687aa-ebb9-4998-bbf5-2241b75f8ad3 Unfortunately I don't have binaries between 1.24.1901.0 and 1.25.2371.0 to pinpoint it more precisely. The real world scenario: run Far in WT, visit a few directories. Every time you enter or exit a directory the tab icon disappears for about 0.5 s to show the progress circle, even though the directory listing finishes much faster than that, which is annoying.
Author
Owner

@DHowett commented on GitHub (Sep 29, 2025):

My first guess is this may be dbf740cf2c

@DHowett commented on GitHub (Sep 29, 2025): My first guess is this may be dbf740cf2c113b9613b22c0895529e68d66e14db
Author
Owner

@DHowett commented on GitHub (Oct 1, 2025):

we apes are way, way slower than machines and cannot notice such minute events with the naked eye.

I mean... considering this, shouldn't it be on a 200ms delay? Flickering it faster than that doesn't help anybody perceive it any better, right?

Maybe we should just switch the function to trailing so that it only takes effect after 200ms, rather than updating once, waiting 200ms, then updating it again. That will prevent it from being visible at all for event durations shorter than 200ms.

@DHowett commented on GitHub (Oct 1, 2025): > we apes are way, way slower than machines and cannot notice such minute events with the naked eye. I mean... considering this, _shouldn't_ it be on a 200ms delay? Flickering it faster than that doesn't help anybody perceive it any better, right? Maybe we should just switch the function to trailing so that it _only_ takes effect after 200ms, rather than updating once, waiting 200ms, then updating it again. That will prevent it from being visible _at all_ for event durations shorter than 200ms.
Author
Owner

@DHowett commented on GitHub (Oct 1, 2025):

Team consensus is that if you had filed the first video as a bug, we also would have been like "YUP THAT IS A BUG". We should just use a trailing function (not debounced, just trailing) for updating progress states.

@DHowett commented on GitHub (Oct 1, 2025): Team consensus is that if you had filed the _first_ video as a bug, we also would have been like "YUP THAT IS A BUG". We should just use a trailing function (not debounced, just trailing) for updating progress states.
Author
Owner

@alabuzhev commented on GitHub (Oct 1, 2025):

Thanks for looking into this.
I'm not familiar enough with the implementation to comment on trailing / debounced / whatever, but "only takes effect after 200ms" sounds reasonable.
No objections to "the first video is also a bug". It was just way less visible, so I only noticed the flickering while recording.

@alabuzhev commented on GitHub (Oct 1, 2025): Thanks for looking into this. I'm not familiar enough with the implementation to comment on trailing / debounced / whatever, but "only takes effect after 200ms" sounds reasonable. No objections to "the first video is also a bug". It was just way less visible, so I only noticed the flickering while recording.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23657