JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
16.5k stars 2.32k forks source link

ExportedCommands only contains Set-PoshPrompt #1808

Closed dpaulson45 closed 2 years ago

dpaulson45 commented 2 years ago

Code of Conduct

What happened?

In version 6.14.0 there was the following ExportedCommands

Key                    Value
---                    -----
Get-PoshInfoForV2Users Get-PoshInfoForV2Users
Get-PoshThemes         Get-PoshThemes
Set-PoshPrompt         Set-PoshPrompt
Get-ThemesLocation     Get-ThemesLocation
Set-Prompt             Set-Prompt
Show-Colors            Show-Colors
Show-ThemeColors       Show-ThemeColors
Show-ThemeSymbols      Show-ThemeSymbols
Write-ColorPreview     Write-ColorPreview

In Version 7.24.0, only Set-PoshPrompt is available to export.

Based off your docs, you should still have Get-PoshThemes at least to see all the possible themes and what they look like.

https://ohmyposh.dev/docs/themes

Theme

NA

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Write-PoshDebug isn't even a command in this version, that appears to be in 7.5.1 but not in any newer module's versions.
JanDeDobbeleer commented 2 years ago

@dpaulson45 it's available but as a global function. Not part of the module.

dpaulson45 commented 2 years ago

@JanDeDobbeleer only if you have the old modules in the profile

JanDeDobbeleer commented 2 years ago

If you init the prompt you automatically get those cmdlets available. But they're indeed not available after Import-Module.

dpaulson45 commented 2 years ago

image

Add back an older module version under my profile

image

Then able to run the command

image

and loaded old module

image

dpaulson45 commented 2 years ago

Okay, I get what you are saying now. You need to run Set-PoshPrompt even though I don't know what I might like just yet. And unable to run Get-PoshThemes till after I do that.

A bad design to load your other cmdlets from a module that way.

Recommend at least updating your docs on this.

JanDeDobbeleer commented 2 years ago

@dpaulson45 clean system installation

image

The reason it doesn't work is that you need to initialise the prompt either via Set-PoshPrompt (deprecated) or the command I added inline, or for you oh-my-posh --init --shell pwsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$(oh-my-posh --version)/themes/jandedobbeleer.omp.json | Invoke-Expression

JanDeDobbeleer commented 2 years ago

@dpaulson45 it's a bit rude to come to that conclusion without understanding the bigger picture. This isn't subject to change anymore as it facilitates having the core functionality in the binary and the module only acts as a wrapper around that. This makes extending everything a lot easier even if it means "sacrificing" good module design. Remember, I'm doing this for free, during moments where I could instead enjoy family life or leisure.

github-actions[bot] commented 5 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.