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

oh-my-posh v3 doesn't support Raspbian with PowerShell #629

Closed
sba923 opened this issue Apr 11, 2021 · 2 comments
Closed

oh-my-posh v3 doesn't support Raspbian with PowerShell #629

sba923 opened this issue Apr 11, 2021 · 2 comments
Labels
🚀 feat New feature

Comments

@sba923
Copy link

sba923 commented Apr 11, 2021

Prerequisites

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

Description

oh-my-posh v3 doesn't support Raspbian with PowerShell, it tries launching an inappropriate binary, reusing in an error message.

Environment

  • Oh my Posh version: 3.134.0
  • Theme: jandedobbeleer
  • Operating System: Raspbian Stretch
  • Shell: PowerShell 7.1.3
  • Terminal: MobaXterm

Steps to Reproduce

  1. Install oh-my-posh 3.134.0 using Install-Module oh-my-posh -Force -AllowPrerelease
  2. Run Set-PoshPrompt -theme jandedobbeleer

Expected behavior:
The expected prompt should be displayed

Actual behavior:
The following error message is displayed:

ResourceUnavailable: /home/pi/.local/share/powershell/Modules/oh-my-posh/3.134.0/oh-my-posh.psm1:60
Line |
  60 |      Invoke-Expression (& $poshCommand --init --shell=pwsh --config="$ …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Program 'posh-linux-amd64' failed to run: Exec format errorAt
     | /home/pi/.local/share/powershell/Modules/oh-my-posh/3.134.0/oh-my-posh.psm1:60 char:24 + … ke-Expression (& $poshCommand
     | --init --shell=pwsh --config="$config") +                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.

Here's a fix, I'll submit a PR:

diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1
index ad90dae..bf3be81 100644
--- a/packages/powershell/oh-my-posh/oh-my-posh.psm1
+++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1
@@ -10,7 +10,7 @@ function Get-PoshCommand {
     if ($IsLinux) {
         # this is rather hacky but there's no other way for the time being
         $arch = uname -m
-        if ($arch -eq 'aarch64') {
+        if (($arch -eq 'aarch64') -or ($arch -eq 'armv7l')) {
             return "$PSScriptRoot/bin/posh-linux-arm"
         }
         return "$PSScriptRoot/bin/posh-linux-amd64"
@JanDeDobbeleer JanDeDobbeleer added the 🚀 feat New feature label Apr 11, 2021
JanDeDobbeleer added a commit that referenced this issue Apr 11, 2021
@sba923
Copy link
Author

sba923 commented Apr 11, 2021

Great you picked that up!

Been struggling with PR support in VScode, didn't manage to create the promised PR so far... now I won't have to solve that issue... for now 😋

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀 feat New feature
Projects
None yet
Development

No branches or pull requests

2 participants