cmder: oh-my-posh startup scripts in user_profile.ps1 don't work

Purpose of the issue

  • Bug report (encountered problems/errors)
  • Feature request (request for new functionality)
  • Question

Description of the issue

Put oh-my-posh startup scripts in user_profile.ps1:

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

It doesn’t work. If these scripts are written to profile.ps1, it works. Is there something wrong?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 22 (12 by maintainers)

Most upvoted comments

I am using the latest version and still find that including a call to Set-Theme mytheme in my user_profile.ps1 does not set the theme. Running the command after the powershell tab loads works fine.

My current work around is to set the theme in the vendor/profile.ps1 on the very last line (after Set-Item -Path function:\prompt...

And, for what it’s worth, if I set the theme just prior to this line it does not work.

Working vendor/profile.ps:

# Functions can be made constant only at creation time
# ReadOnly at least requires `-force` to be overwritten
Set-Item -Path function:\prompt  -Value $Prompt  -Options ReadOnly
Set-Theme mytheme

Not Working vendor/profile.ps:

# Functions can be made constant only at creation time
# ReadOnly at least requires `-force` to be overwritten
Set-Theme mytheme
Set-Item -Path function:\prompt  -Value $Prompt  -Options ReadOnly

@Retia-Adolf yes it will be included in the next release.

@greyze yeah don’t do that try the pre release I suggested to @riverscn and add what you want to cmder\config\user_profile.ps1

@riverscn can you try this pre-release and confirm if it helps?