Skip to content

Task terminal icon has color glitch #249580

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anthonykim1
Copy link
Contributor

Resolves: #234602

For me, the icon is always white color (regardless of hover&focused), even when task terminal is in failed/error state.
I made some changes in the taskTerminalStatus.ts file, but then this makes the icon ALWAYS red for failed/error state task terminal.

I'm thinking there may be some focused/hover related thing I might be missing @meganrogge

@anthonykim1 anthonykim1 self-assigned this May 22, 2025
@anthonykim1 anthonykim1 added the bug Issue identified by VS Code Team member as probable bug label May 22, 2025
@anthonykim1 anthonykim1 requested a review from meganrogge May 22, 2025 20:02
@anthonykim1
Copy link
Contributor Author

After this PR I get:
Screenshot 2025-05-22 at 12 29 24 PM
and
Screenshot 2025-05-22 at 12 29 21 PM

whereas before, the tool icon is always white:
Screenshot 2025-05-22 at 1 03 27 PM

export const FAILED_TASK_STATUS: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, icon: { ...Codicon.error, color: { id: problemsErrorIconForeground } }, severity: Severity.Error, tooltip: nls.localize('taskTerminalStatus.errors', "Task has errors") };
const FAILED_INACTIVE_TASK_STATUS: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, icon: { ...Codicon.error, color: { id: problemsErrorIconForeground } }, severity: Severity.Error, tooltip: nls.localize('taskTerminalStatus.errorsInactive', "Task has errors and is waiting...") };
const WARNING_TASK_STATUS: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, icon: { ...Codicon.warning, color: { id: problemsWarningIconForeground } }, severity: Severity.Warning, tooltip: nls.localize('taskTerminalStatus.warnings', "Task has warnings") };
const WARNING_INACTIVE_TASK_STATUS: ITerminalStatus = { id: TASK_TERMINAL_STATUS_ID, icon: { ...Codicon.warning, color: { id: problemsWarningIconForeground } }, severity: Severity.Warning, tooltip: nls.localize('taskTerminalStatus.warningsInactive', "Task has warnings and is waiting...") };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think these had effect, but the terminalData.terminal.changeColor?.(problemsErrorIconForeground, true); was what allowed me to really change the color of the icon.

Trying to figure out how I can change the red -> white on user focusing the failed terminal tab.
It seems like it does for the other x icon and the terminal title itself.

@anthonykim1 anthonykim1 requested a review from Copilot May 22, 2025 21:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that task terminal status icons use the appropriate problem-theme colors for error and warning states.

  • Imports problemsErrorIconForeground and problemsWarningIconForeground and applies them to the status icon definitions.
  • Adds runtime calls to terminal.changeColor in active and inactive branches to override icon colors.

@@ -125,8 +132,16 @@ export class TaskTerminalStatus extends Disposable {
} else if (terminalData.problemMatcher.maxMarkerSeverity === MarkerSeverity.Error) {
this._accessibilitySignalService.playSignal(AccessibilitySignal.taskFailed);
terminalData.terminal.statusList.add(FAILED_INACTIVE_TASK_STATUS);
terminalData.terminal.changeColor?.(problemsErrorIconForeground, true); // works but stays red even when focused/hover
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling changeColor here without a corresponding revert or reset means the icon may never return to its default color. Introduce logic on blur/unhover or theme change to restore the original color.

Suggested change
terminalData.terminal.changeColor?.(problemsErrorIconForeground, true); // works but stays red even when focused/hover
terminalData.terminal.changeColor?.(problemsErrorIconForeground, true); // works but stays red even when focused/hover
terminalData.terminal.onBlur(() => terminalData.terminal.resetColor?.());
terminalData.terminal.onUnhover(() => terminalData.terminal.resetColor?.());

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

completely irrelevant. terminalData.terminal.onUnhover(() => terminalData.terminal.resetColor?.()); doesnt exist in real life

@anthonykim1 anthonykim1 requested a review from Copilot May 23, 2025 09:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses the issue where task terminal status icons remained white by assigning theme colors to error and warning icons and programmatically updating the icon color on focus/inactive states.

  • Import and apply problemsErrorIconForeground and problemsWarningIconForeground to error/warning status icons
  • Updated FAILED_* and WARNING_* statuses to include a color property
  • Added terminal.changeColor calls in the TaskTerminalStatus class to enforce the themed colors
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.ts:111

  • Consider adding automated tests to verify that changeColor correctly applies and resets icon colors on focus and hover, preventing regressions of the color glitch.
terminalData.terminal.changeColor?.(problemsErrorIconForeground, true);

@meganrogge
Copy link
Contributor

@anthonykim1 we want the icon to stay red for as long as the task has errors -- is that what happens via this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

icon is not colored correctly for failing task terminal
2 participants