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

Auto-show progress in task bar based on contents of last line of buffer #8449

Open
Tracked by #6700
kishanth-ithayakumar opened this issue Dec 1, 2020 · 7 comments
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Milestone

Comments

@kishanth-ithayakumar
Copy link

Description of the new feature/enhancement

Display percentage loading indicator in windows taskbar.
image

  1. Read the last output line in the console.
  2. If there's a string, such as "12%" or "12/100" then, display the percentage in task bar.

Proposed technical implementation details (optional)

@kishanth-ithayakumar kishanth-ithayakumar added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Dec 1, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 1, 2020
@zadjii-msft
Copy link
Member

IIRC, this is something that ConEmu does, so we could add a setting to enable this too. I'll link it up with the others at #6700, thanks!

@zadjii-msft zadjii-msft added Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Dec 1, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Dec 1, 2020
@zadjii-msft zadjii-msft changed the title Loading indicator in task bar Auto-show progress in task bar based on contents of last line of buffer Dec 1, 2020
@skyline75489
Copy link
Collaborator

Some thoughts: if every single line needs to be read to determine whether it's an progress indicator line like 42% (42/100), would it cause measurably impact on performance? I highly suspect that it would, no matter how fast regex is. Just imagine how much output bcz produces. We definitely do not want to throw all the CPU away after all the hard work trying to save as many as CPU cycles as possible.

So here's my two cents. The progress indicator line ususally just sticks right at the bottom, right? We should detect this scenerio instead of filtering every single line that's feed to us.

@zadjii-msft
Copy link
Member

I believe that's how ConEmu and mintty implemented this as well - it's only detection on the very last line.

@DHowett DHowett added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) and removed Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 17, 2020
@DHowett
Copy link
Member

DHowett commented Dec 17, 2020

Backlog approved!

@dannyvv
Copy link
Member

dannyvv commented Jan 14, 2021

@DHowett When considering, please also consider supporting the existing api's for windows' taskbar:

There is also some existing art for AzureDevops where special markers in the text stream can show percentage completed of a task.

It would be great if these could be unified. (maybe get agreement on some metadata markers for this) I.e. if the shell could standardize on a pattern that then other systems like github actions, azure devops could consume as is.

image
It would be great if these would work in the tabs (and perhaps translate the 'latest' or 'in focus' tab to the windows taskbar.

@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Jan 15, 2021

@dannyvv, letting ITaskbarList3::SetProgressState set progress on the window returned by GetConsoleWindow and making Windows Terminal proxy that to its own window looks difficult to me:

  • ITaskbarList3 has no GetProgressState method with which Windows Terminal could read the changes made by the application.
  • Even if there were such a method, I don't think there is a notification about progress changes, so Windows Terminal would have to poll.

Perhaps Windows Terminal could instead use ITaskbarList3::RegisterTab to show all panes (not just tabs) in the task bar, and let the task bar combine the progress info… but I guess this would require the registered windows to be visible.

Anyway, it seems the implementation would be complex and almost separate from what was previously requested in this issue.

Making BuildXL output the OSC 9;4 sequence might be much easier.

@DHowett
Copy link
Member

DHowett commented Jan 20, 2021

Indeed. We talked about this way back when we were first doing ConPTY stuff, and it's capital-H hard. It only works in BXL (and razzle!) because we made the mistake of allowing applications DIRECT unfettered access to the console window handle, which we just can't do any longer. Switching to OSC 9;4 makes it compatible with more terminal emulators on Windows, and even has the benefit of working over a remote connection (say you're remoting to a build machine to fix a build break.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

6 participants