microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.39k stars 8.3k forks source link

Default profile can point to one deleted in state.json #14420

Open carlos-zamora opened 1 year ago

carlos-zamora commented 1 year ago

Windows Terminal version

1.17.2982.0

Windows build number

25236.1010

Other Software

PowerShell (potentially caused by multiple versions installed?)

Steps to reproduce

  1. Open Windows Terminal (see PowerShell Core profile)
  2. Open new tab (different PowerShell profile appears)

Helpful info

settings.zip

defaultProfile is set to a legacy version of powershell core. However, that profile doesn't exist anymore. It's interesting that...

  1. resolving it on startup results in a different profile than when hitting the new tab button
  2. I can't seem to edit that profile? It doesn't seem like it's hidden. Idk why it still resolves correctly?

Expected Behavior

Both tabs should contain the same profile

Actual Behavior

Both tabs have different profiles.

DHowett commented 1 year ago

The PowerShell generator finds the "best" version of PowerShell and assigns that one the "PowerShell Core" GUID. If your "best" version of PowerShell is outdated, that indicates either a bug in our algorithm or on your machine. We should debug!

PankajBhojwani commented 1 year ago

Initial probable cause: the profile has been deleted. Will live debug this when Carlos gets back.

zadjii-msft commented 1 year ago

oh boy, our logic for "your default profile doesn't exist" might not work for a deleted dynamic profile

PankajBhojwani commented 1 year ago

Or, this might be a dup of #14061 or #13916