Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
jetersen opened this issue Feb 24, 2021 · 12 comments
Closed
2 tasks done
Labels
🐛 bug Something isn't working

Comments

@jetersen
Copy link
Contributor

jetersen commented Feb 24, 2021

Prerequisites

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

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

  • Oh my Posh version: 3.96.0
  • Theme: custom theme based on JanDeDobbeleer (will add it to my dotfiles later)
  • Operating System: Windows 10/Ubuntu 2004 (WSL)
  • Shell: zsh/pwsh
  • Terminal: Windows Terminal

Steps to Reproduce

scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
@JanDeDobbeleer
Copy link
Owner

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

@JanDeDobbeleer JanDeDobbeleer added the 🐛 bug Something isn't working label Feb 24, 2021
@jetersen
Copy link
Contributor Author

jetersen commented Feb 24, 2021

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 added a commit that referenced this issue Feb 24, 2021
@JanDeDobbeleer
Copy link
Owner

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

@jetersen
Copy link
Contributor Author

🚀 Thanks for the quick fix once again!

@glucas
Copy link

glucas commented Feb 24, 2021

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 ScoopInstaller/Main#1866 since I assume other folks like myself might find oh-my-posh via that default bucket.

@Lucky-Loek
Copy link

Lucky-Loek commented Feb 25, 2021

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
Copy link
Contributor Author

jetersen commented Feb 25, 2021

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

@Lucky-Loek
Copy link

Lucky-Loek commented Feb 25, 2021

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
Copy link
Owner

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

@Lucky-Loek
Copy link

Lucky-Loek commented Feb 25, 2021

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
Copy link

glucas commented Feb 25, 2021

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants