JanDeDobbeleer / oh-my-posh

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

scoop install creates an oh-my-posh-wsl.ps1 which is not useful in WSL #449

Closed jetersen closed 3 years ago

jetersen commented 3 years ago

Prerequisites

Description

seems scoop does not provide a proper shim I suspect it wants .exe in the bin section to create application shim rather than a ps1 shim. I slightly remember something about being able to configuring bin for scoop.

Environment

Steps to Reproduce

scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
JanDeDobbeleer commented 3 years ago

Wait, you're telling me it installs the unix binary as oh-my-posh-wsl.ps1?

jetersen commented 3 years ago

nah it creates a .ps1 file with the following content:

if (!(Test-Path Variable:PSScriptRoot)) { $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent }
$path = join-path "$psscriptroot" "..\apps\oh-my-posh\current\oh-my-posh-wsl"
if($myinvocation.expectingInput) { $input | & $path  @args } else { & $path  @args }
ll

    Directory:  C:\Users\joseph\scoop\shims

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        25/10/2020     10.43     7,50KB 7z.exe
-a---        24/02/2021     09.21      260   7z.ps1
-a---        24/02/2021     09.21       55   7z.shim
-a---        24/02/2021     09.21      274   oh-my-posh-wsl.ps1
-a---        25/10/2020     10.43     7,50KB oh-my-posh.exe
-a---        24/02/2021     09.21      274   oh-my-posh.ps1
-a---        24/02/2021     09.21       69   oh-my-posh.shim
-a---        24/02/2021     09.20      117   scoop
-a---        24/02/2021     09.20      340   scoop.cmd
-a---        24/02/2021     09.20      268   scoop.ps1
JanDeDobbeleer commented 3 years ago

@jetersen seems to work now (at least adding to PATH)

jetersen commented 3 years ago

🚀 Thanks for the quick fix once again!

glucas commented 3 years ago

Hm, I had oh-my-posh3 installed via scoop from the default main bucket and it had been working fine until this change. Now it fails to update. I guess that is an issue for that repo, however.

I filed https://github.com/ScoopInstaller/Main/issues/1866 since I assume other folks like myself might find oh-my-posh via that default bucket.

Lucky-Loek commented 3 years ago

This update breaks my installation, since the oh-my-posh.exe can't be found anymore. The executable isn't copied to Scoop's shims directory anymore, and the update doesn't add this repo's bin folder to my path either. Fixing it is easy enough (just add it to the path manually), but I imagine this not being desired behavior?

Error image

Shims folder image

User env image

System env image

jetersen commented 3 years ago

scoop should add it to your path. Try uninstalling and reinstalling with scoop. image

Lucky-Loek commented 3 years ago

I know, but it doesn't on my machine 😜 Reinstalling does not work either. I'll add it manually and see what happens with the next update. If that still breaks, I'll create a new issue and dive in a bit deeper.

JanDeDobbeleer commented 3 years ago

@Lucky-Loek it did add it to my PATH when testing. Had to reboot though for it to show up.

Lucky-Loek commented 3 years ago

Oooh ofc, that makes sense. It's still Windows so PATH changes need a reboot.. Thanks for the quick reply! (and the awesome tool!)

glucas commented 3 years ago

FWIW installing via the scoop main bucket worked find for me once the issue I mentioned above was resolved. That bucket's manifest still creates shims and did not require rebooting.

jetersen commented 3 years ago

shims are undesirable for the oh-my-posh-wsl binary which is also not covered by the manifest in the main bucket... 😉

github-actions[bot] commented 6 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.