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

Background & foreground formatting of command options broken in Windows PowerShell in WT 1.22.10352.0 #18520

Closed
wolf99 opened this issue Feb 6, 2025 · 3 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@wolf99
Copy link
Contributor

wolf99 commented Feb 6, 2025

Windows Terminal version

1.22.10352.0

Windows build number

10.0.19045.0

Other Software

Windows PowerShell 5.1.19041.5369

Steps to reproduce

  1. Open WT
  2. Open a Windows PowerShell tab in WT
  3. Type a command with an option, e.g.: winget update

Expected Behavior

The command option (update in the above example) should have the correct foreground and background colors and formatting.
In previous WT version (v1.21.10351.0) this worked as expected.
i.e. the command option foreground (text color) was grey and italicised, the background was the normal poowershell blue.
(There is no theme used for the powershell profile)

Actual Behavior

The command option has incorrect foreground and background color and formatting.
The foreground is white and non-italicised, the background is black (first command line in screenshot)
Using the backspace key results in the text being deleted, but the black foregrouhd is then extended through the deleted area (second command line in screenshot)

Image

@wolf99 wolf99 added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 6, 2025
@wolf99
Copy link
Contributor Author

wolf99 commented Feb 6, 2025

Now I dont seem to be able to rollback to previous version of WT so now I am stuck with this :/

See the last line:

> winget install --id Microsoft.WindowsTerminal --version 1.21.10351.0 --no-upgrade --exact --force               
Found Windows Terminal [Microsoft.WindowsTerminal] Version 1.21.10351.0                                                              
This application is licensed to you by its owner.                                                                                    
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.                                           
This package requires the following dependencies:                                                                                  
    - Packages                                                                                                                       
             Microsoft.UI.Xaml.2.8 [>= 8.2306.22001.0]                                                                                      
Successfully verified installer hash                                                                                                 
Starting package install...                                                                                                           
    ████████████████████████████▌   95%                                                                                                
Installer failed with exit code: 0x80070002 : The system cannot find the file specified.   

Just to cover all bases, I do already have the referred to dependency installed:

> winget install Microsoft.UI.Xaml.2.8
Found an existing package already installed. Trying to upgrade the installed package...
No available upgrade found.
No newer package versions are available from the configured sources.

@j4james
Copy link
Collaborator

j4james commented Feb 6, 2025

I'm afraid the change in color handling is by design. The reasoning is explained in PR #17666, but the gist of it is that you need to upgrade PSReadLine, or use a black/white color scheme if that isn't an option.

As for the rolling back issue, I'll have to leave that for someone else to answer - I have no idea how that is supposed to work.

@wolf99
Copy link
Contributor Author

wolf99 commented Feb 11, 2025

Thanks for sharing this info @j4james !

Based on that I update PowerShellGet and then PSReadline, following the README here: https://github.com/PowerShell/PSReadLine
This has resolved this issue for me.

FYI that I have this situation on a work machine which has Windows (10) and application versions (such as new powershell) controlled by work IT.
I do not have the option to upgrade Windows or applications, nor install new applications, when I want to.
I imagine there are many, many, people in the same situation that will then experience this same issue.
Perhaps this issue and fix could be documented in some FAQ or other appropriate place on this repo?

@wolf99 wolf99 closed this as completed Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants