[PR #10755] [MERGED] Combine progress states in the tab, taskbar #28218

Open
opened 2026-01-31 09:27:06 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10755
Author: @zadjii-msft
Created: 7/22/2021
Status: Merged
Merged: 8/10/2021
Merged by: @undefined

Base: mainHead: dev/migrie/b/progress-bugs


📝 Commits (10+)

  • d5a14f9 Fix a bug where error/warning -> indeterminate would not update the progress value correctly
  • 95a26f0 This is a janky way of compining multiple pane's TB state in the icon at once. Not sure I love it.
  • 2dccf0f Not in love with this.
  • 99c98a1 Merge remote-tracking branch 'origin/main' into dev/migrie/b/progress-bugs
  • 8c0a7db Move TaskbarState to be a WinRT class. We'll need this for the next part...
  • cbbdd38 yay it works
  • 2703447 cleanup
  • 15f03b3 percentage
  • 9d177bf Merge remote-tracking branch 'origin/main' into dev/migrie/b/progress-bugs
  • 75f8ff2 some really clever suggestions from carlos

📊 Changes

16 files changed (+217 additions, -76 deletions)

View changed files

📝 src/cascadia/TerminalApp/AppLogic.cpp (+2 -19)
📝 src/cascadia/TerminalApp/AppLogic.h (+1 -2)
📝 src/cascadia/TerminalApp/AppLogic.idl (+1 -2)
📝 src/cascadia/TerminalApp/Pane.cpp (+23 -0)
📝 src/cascadia/TerminalApp/Pane.h (+3 -0)
src/cascadia/TerminalApp/TaskbarState.cpp (+45 -0)
src/cascadia/TerminalApp/TaskbarState.h (+34 -0)
src/cascadia/TerminalApp/TaskbarState.idl (+15 -0)
📝 src/cascadia/TerminalApp/TerminalAppLib.vcxproj (+7 -0)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+24 -18)
📝 src/cascadia/TerminalApp/TerminalPage.h (+1 -2)
📝 src/cascadia/TerminalApp/TerminalPage.idl (+2 -2)
📝 src/cascadia/TerminalApp/TerminalTab.cpp (+47 -26)
📝 src/cascadia/TerminalApp/TerminalTab.h (+1 -0)
📝 src/cascadia/WindowsTerminal/AppHost.cpp (+5 -4)
📝 src/cascadia/WindowsTerminal/IslandWindow.cpp (+6 -1)

📄 Description

Summary of the Pull Request

background-progress-000

This PR causes the Terminal to combine taskbar states at the tab and window level, according to the MSDN docs for SetProgressState.

This allows the Terminal's taskbar icon to continue showing progress information, even if you're in a pane/tab that doesn't have progress state. This is helpful for cases where the user may be running a build in one tab, and working on something else in another.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

This also fixes a related bug where transitioning from the "error" or "warning" state directly to the "indeterminate" state would cause the taskbar icon to get stuck in a bad state.

Validation Steps Performed

progress.cmd
@echo off
setlocal enabledelayedexpansion

set _type=3
if (%1) == () (
    set _type=3
) else (
    set _type=%1
)



if (%_type%) == (0) (
    <NUL set /p =]9;4
    echo Cleared progress
)
if (%_type%) == (1) (
    <NUL set /p =]9;4;1;25
    echo Started progress (normal, 25^)
)
if (%_type%) == (2) (
    <NUL set /p =]9;4;2;50
    echo Started progress (error, 50^)
)
if (%_type%) == (3) (
    @rem start indeterminate progress in the taskbar
    @rem this `<NUL set /p =` magic will output the text _without a newline_

    <NUL set /p =]9;4;3
    echo Started progress (indeterminate, {omitted})
)
if (%_type%) == (4) (
    <NUL set /p =]9;4;4;75
    echo Started progress (warning, 75^)
)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/10755 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 7/22/2021 **Status:** ✅ Merged **Merged:** 8/10/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/progress-bugs` --- ### 📝 Commits (10+) - [`d5a14f9`](https://github.com/microsoft/terminal/commit/d5a14f9a1f161c45943136700013a3246a868c76) Fix a bug where error/warning -> indeterminate would not update the progress value correctly - [`95a26f0`](https://github.com/microsoft/terminal/commit/95a26f09cc5a5ffbc155759525b42442fd57a83f) This is a janky way of compining multiple pane's TB state in the icon at once. Not sure I love it. - [`2dccf0f`](https://github.com/microsoft/terminal/commit/2dccf0fade3f8a48b25503908da9ae4998c76ea0) Not in love with this. - [`99c98a1`](https://github.com/microsoft/terminal/commit/99c98a114eddd29ed727c43ac3945a6ef0ef6add) Merge remote-tracking branch 'origin/main' into dev/migrie/b/progress-bugs - [`8c0a7db`](https://github.com/microsoft/terminal/commit/8c0a7db88b42e704819cd01aa61ea7f35c84c44d) Move TaskbarState to be a WinRT class. We'll need this for the next part... - [`cbbdd38`](https://github.com/microsoft/terminal/commit/cbbdd385385e4b1f04632975c88d50a9080abb3e) yay it works - [`2703447`](https://github.com/microsoft/terminal/commit/2703447e1c10deabeb6eebde93ae1ba333dab959) cleanup - [`15f03b3`](https://github.com/microsoft/terminal/commit/15f03b34610b08912f7f90111833c719adac6b3a) percentage - [`9d177bf`](https://github.com/microsoft/terminal/commit/9d177bf46b05ad700362d2977a0b80a0ffb3d7c0) Merge remote-tracking branch 'origin/main' into dev/migrie/b/progress-bugs - [`75f8ff2`](https://github.com/microsoft/terminal/commit/75f8ff2390dd1229ced5a2df1aebc5caa5e2a30b) some really clever suggestions from carlos ### 📊 Changes **16 files changed** (+217 additions, -76 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+2 -19) 📝 `src/cascadia/TerminalApp/AppLogic.h` (+1 -2) 📝 `src/cascadia/TerminalApp/AppLogic.idl` (+1 -2) 📝 `src/cascadia/TerminalApp/Pane.cpp` (+23 -0) 📝 `src/cascadia/TerminalApp/Pane.h` (+3 -0) ➕ `src/cascadia/TerminalApp/TaskbarState.cpp` (+45 -0) ➕ `src/cascadia/TerminalApp/TaskbarState.h` (+34 -0) ➕ `src/cascadia/TerminalApp/TaskbarState.idl` (+15 -0) 📝 `src/cascadia/TerminalApp/TerminalAppLib.vcxproj` (+7 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+24 -18) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+1 -2) 📝 `src/cascadia/TerminalApp/TerminalPage.idl` (+2 -2) 📝 `src/cascadia/TerminalApp/TerminalTab.cpp` (+47 -26) 📝 `src/cascadia/TerminalApp/TerminalTab.h` (+1 -0) 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+5 -4) 📝 `src/cascadia/WindowsTerminal/IslandWindow.cpp` (+6 -1) </details> ### 📄 Description ## Summary of the Pull Request ![background-progress-000](https://user-images.githubusercontent.com/18356694/126653006-3ad2fdae-67ae-4cdb-aa46-25d09217e365.gif) This PR causes the Terminal to combine taskbar states at the tab and window level, according to the [MSDN docs for `SetProgressState`](https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressstate#how-the-taskbar-button-chooses-the-progress-indicator-for-a-group). This allows the Terminal's taskbar icon to continue showing progress information, even if you're in a pane/tab that _doesn't_ have progress state. This is helpful for cases where the user may be running a build in one tab, and working on something else in another. ## References * [`SetProgressState`](https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressstate#how-the-taskbar-button-chooses-the-progress-indicator-for-a-group) * Progress mega: #6700 ## PR Checklist * [x] Closes #10090 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments This also fixes a related bug where transitioning from the "error" or "warning" state directly to the "indeterminate" state would cause the taskbar icon to get stuck in a bad state. ## Validation Steps Performed <details> <summary><code>progress.cmd</code></summary> ```cmd @echo off setlocal enabledelayedexpansion set _type=3 if (%1) == () ( set _type=3 ) else ( set _type=%1 ) if (%_type%) == (0) ( <NUL set /p =]9;4 echo Cleared progress ) if (%_type%) == (1) ( <NUL set /p =]9;4;1;25 echo Started progress (normal, 25^) ) if (%_type%) == (2) ( <NUL set /p =]9;4;2;50 echo Started progress (error, 50^) ) if (%_type%) == (3) ( @rem start indeterminate progress in the taskbar @rem this `<NUL set /p =` magic will output the text _without a newline_ <NUL set /p =]9;4;3 echo Started progress (indeterminate, {omitted}) ) if (%_type%) == (4) ( <NUL set /p =]9;4;4;75 echo Started progress (warning, 75^) ) ``` </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:27:06 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28218