Oh-my-posh3: Regression - Navigate to PowerShell Drive causes theme to not render anymore

Created on 29 Oct 2020  路  6Comments  路  Source: JanDeDobbeleer/oh-my-posh3

Prerequisites

  • [x] I have read and understand the CONTRIBUTING guide
  • [x] I looked for duplicate issues before submitting this one

Description

Regression when using a PSDrive. Theme is not rendered anymore.

Before 3.20.4:

image

After 3.23.5:

image

Environment

  • Oh my Posh version: see above
  • Theme: custom
  • Operating System: MacOs
  • Shell: PowerShell 7.1 rc2
  • Terminal: iTerm2

Steps to Reproduce

Navigate to the PowerShell temp drive

cd temp:

Expected behavior: [What you expected to happen]

Normal behavior as before

Actual behavior: [What actually happened]

Theme doesn't render anymore

All 6 comments

I know why this happens but I need to find out how to fix this. Basically the new invocation fails because that path only exists in PowerShell and $startInfo.WorkingDirectory is invalid.

The problem is that the fix will probably result in git and other info not working anymore. I'll give this some thought first.

Maybe?

if ($PWD.Provider.Name -eq "FileSystem") {
  $startInfo.WorkingDirectory = "$($PWD.ProviderPath)"
}

That fixes it. Let's see if I can ship this tomorrow morning as today (as you can see) I'm fried.

No worries! I've unblocked myself :) Have a good rest! almost weekend 馃嵑

I think this way the could even be removed. I'll debug on Windows as well to be sure. Thanks a bunch for pairing 馃檹馃徎

Was this page helpful?
0 / 5 - 0 ratings