Closed isti115 closed 2 years ago
@Isti115 the icon in the code is for displaying the OS, not necessarily related to it being supported although it should work nonetheless. According to the module that file is included, and paths aren't hardcoded due to obvious reasons 😅. Unless Powershell is having a hard time when it comes to those paths (they don't seem weird to me), we'll need to have a look at what's happening. If you run Get-ChildItem "$((Get-Module oh-my-posh).ModuleBase)/bin"
, what do you see?
Thanks for the quick response! I get what I would assume is the desired output:
~> Get-ChildItem "$((Get-Module oh-my-posh).ModuleBase)/bin"
Directory: /home/isti/.local/share/powershell/Modules/oh-my-posh/3.162.0/bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 6/5/2021 1:19 PM 17472952 posh-darwin-amd64
----- 6/5/2021 1:19 PM 16504842 posh-linux-amd64
----- 6/5/2021 1:19 PM 14722682 posh-linux-arm
----- 6/5/2021 1:19 PM 15443968 posh-windows-386.exe
----- 6/5/2021 1:19 PM 16897536 posh-windows-amd64.exe
~>
Yes. Meaning the file is there. Let me try to reproduce this, but I need to set up a VM in that case.
@Isti115 binaries don't don't work by default on Nix so that's the issue. Starship has a separate package for example specifically for Nix, so we'll need to look at that (or patch the binary).
Wow, thanks for digging into this as deep as setting up a VM! :) Now that you mention it I recall that I have also heard about the binary incompatibility earlier, I was just too tunnelvisioned on the weird paths after finding that first answer for this type of error. This implies that if I build it myself from source, it should work, right? I'll try to give that a go!
After cloning and setting up go, building and overwriting the binary it now works beautifully! :tada:
(Man, this piece of software is so awesome, I just realized it again after missing my custom theme with icons for path locations, indicator for ranger
/ lf
level and such for two days! Thank you very much for the development of this great customizable and extensible utility!)
[I don't exactly know what combination of commands I used after several failed attempts at go run main.go
and such, since this was my first time using Go and I had no idea how dependecies and includes are handled, but something like this should work for anyone who wishes to replicate the successful steps in the future:
nix-env -iA nixos.go
git clone git@github.com:JanDeDobbeleer/oh-my-posh.git
cd ./oh-my-posh/src/
go build .
cp ./oh-my-posh ~/.local/share/powershell/Modules/oh-my-posh/3.162.0/bin/posh-linux-amd64
ps.: In case you have a newer version, make sure to update the numer in the path!]
I'll add the manual steps on how to compile to the docs. You don't need to use the module in this case, you can simply follow the nix guide and use the executable.
While we are on the subject of nix, one can also pull oh-my-posh via this nix derivation: https://gitlab.com/ShrykeWindgrace/powershell-modules/-/tree/master/oh-my-posh and then modify $env:PSModulePath
accordingly. Pardon my self-promotion=)
I noticed the same issue in GitHub CodeSpaces.
using: mcr.microsoft.com/vscode/devcontainers/dotnet:5.0
Linux codespaces_89ccbb 5.4.0-1055-azure #57ü18.04.1-Ubuntu SMP Fri Jul 16 19:40:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
As the module is no longer available, this is solved by installing via homebrew.
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.
Prerequisites
CONTRIBUTING
guideDescription
I installed NixOS with powershell as my default shell today, posh-git works fine, but this module gives the following error message:
While trying to figure this out I also noticed that running the file directly from the shell gives a similar error:
which after reading a bit about it online gives the impression of a hardcoded shebang path or something like that.
Sh and Bash straight up claim that the file doesn't even exist:
Paths are VERY different in NixOS, so I tried symlinking the executable from the store to
/bin/pwsh
and/usr/bin/pwsh
, but that didn't solve the issue. I guess that NixOS is kind of supported, since there is an icon for it in the code, so it has probably already worked at some point.Environment
Optional
Steps to Reproduce
Expected behavior: The theme should be loaded
Actual behavior: I get the error message presented above.