Skip to content

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

Open

Description

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)

Activity

  1. added
    Issue-Feature
    on Dec 1, 2020
  2. ghost added
    Needs-Triage
    on Dec 1, 2020
  3. ghost added
    Needs-Tag-Fix
    on Dec 1, 2020
  4. zadjii-msft commented on Dec 1, 2020

    @zadjii-msft
    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!

  5. added
    Issue-Task
    Product-Terminal
    and removed
    Issue-Feature
    on Dec 1, 2020
  6. changed the title [-]Loading indicator in task bar[/-] [+]Auto-show progress in task bar based on contents of last line of buffer[/+] on Dec 1, 2020
  7. skyline75489 commented on Dec 16, 2020

    @skyline75489
    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.

  8. zadjii-msft commented on Dec 16, 2020

    @zadjii-msft
    Member

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

  9. added
    Area-TerminalControl
    and removed
    Needs-Tag-Fix
    Needs-Triage
    on Dec 17, 2020
  10. DHowett commented on Dec 17, 2020

    @DHowett
    Member

    Backlog approved!

  11. dannyvv commented on Jan 14, 2021

    @dannyvv
    Member

    Dustin L. Howett (@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.

  12. KalleOlaviNiemitalo commented on Jan 15, 2021

    @KalleOlaviNiemitalo

    Danny van Velzen (@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.

  13. DHowett commented on Jan 20, 2021

    @DHowett
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-TerminalControlIssue-TaskProduct-Terminal

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions