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

Issue with Apple Silicon #540

Closed
boarder2 opened this issue Mar 17, 2021 · 6 comments
Closed

Issue with Apple Silicon #540

boarder2 opened this issue Mar 17, 2021 · 6 comments

Comments

@boarder2
Copy link
Contributor

Description

When trying to use OMP on an Apple Silicon device with zsh

Environment

  • Oh my Posh version: 3.115.0
  • Theme: any
  • Operating System: macOS 11.2.3 on Apple Silicon
  • Shell: zsh
  • Terminal: iTerm2 or default Terminal

Steps to Reproduce

  1. Install OMP via instructions on the website
  2. Open a terminal

Expected behavior: Prompt should show as expected

Actual behavior: Shows the following error then the default prompt
(eval):1: bad pattern: ^[[38

I've narrowed it down to

eval "$(::OMP:: --config $POSH_THEME --error $omp_last_error --execution-time $omp_elapsed --eval)"

I've attempted to compile OMP locally to dig further but ran into issues with getting go-bindata to work.

@JanDeDobbeleer
Copy link
Owner

@boarder2 you don't need go-bindata anymore, is there still an indication it's used somewhere? The eval works for me on zsh using macOS on intel. That should work regardless. Can you execute oh-my-posh --version from the CLI?

@royvou
Copy link

royvou commented Mar 17, 2021

One interesting thing would be if rosetta is enabled for the shell and if it makes a difference!

(e.g. Arm binaries vs x64 binaries with rosetta)

@JanDeDobbeleer
Copy link
Owner

@royvou I was in the assumption it would build the arm version as homebrew handles building locally. Unless that somehow doing funky things.

@royvou
Copy link

royvou commented Mar 17, 2021

@royvou I was in the assumption it would build the arm version as homebrew handles building locally. Unless that somehow doing funky things.

That's the info I wanted to add in the issue! as it could be both (in theory) , depending if the shell was using rosetta or not. (and it might be worth to check if homebrew 3 is installed which has official support for m1 macs)

If I'm correct I've seen a similar issue somewhere else, where the native binary arm version did not work correctly but it did work in rosetta (or was it the other way around?), will try if I can find the source.

@boarder2
Copy link
Contributor Author

@boarder2 you don't need go-bindata anymore, is there still an indication it's used somewhere? The eval works for me on zsh using macOS on intel. That should work regardless. Can you execute oh-my-posh --version from the CLI?

Version of OMP is 3.115.0
Brew version is 3.0.7

Eval also works for me on macOS on Intel

This is where the reference to go-bindata is https://ohmyposh.dev/docs/contributing_started

I was able to get it to compile locally so I can play around if you've got any suggestions where to start!

@boarder2
Copy link
Contributor Author

boarder2 commented Mar 18, 2021

Ok, I think I've tracked this down to shirou/gopsutil#1043

When using --init in the .zshrc eval it uses https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/src/init/omp.zsh

Which doesn't pass a --shell argument and relies on auto detection.

If I replace my .zshrc with the contents of omp.zsh and add a --shell zsh in the eval, it works!

Seems like you could probably hard code the shell type in omp.zsh since you've already made the determination of which shell you're trying to use at that point.

JanDeDobbeleer added a commit that referenced this issue Mar 18, 2021
JanDeDobbeleer added a commit that referenced this issue Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants