Oh-my-posh3: Command Not Found Errors on Windows MSYS2 Zsh

Created on 27 Dec 2020  路  5Comments  路  Source: JanDeDobbeleer/oh-my-posh3

Prerequisites

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

Description

Errors every time I do anything and doesn't load the theme.
Error: omp_precmd:6: command not found: C:UsersMsi.localbinoh-my-posh.exe
The path should have been C:\Users\Msi\.local\bin\oh-my-posh.exe. Works fine with posh.

Environment

  • Oh my Posh version: I don't know how to check, just installed now.
  • Theme: Doesn't matter.
  • Operating System: Windows 10
  • Shell: Zsh on MSYS2
  • Terminal: Windows Terminal

Steps to Reproduce

None.

Expected behavior: Loads and doesn't error.

Actual behavior: Errors with the error above.

bug windows

All 5 comments

Misclicked enter while typing, sorry

Reopened after actually typing the issue body, sorry for misclicking and opening the issue without writing it all.

It escapes the \. Interesting. I'll try to reproduce.

@JanDeDobbeleer I don't know if it's the proper fix, but I was able to resolve this by adding this to the top of the getShellInitScript function

executable = strings.ReplaceAll(executable, "\\", "/")

I hope this saves you a bit of time. I don't know enough about the new init feature or the different shell combinations to know whether this breaks things for some other use case.

@TravisTX that should work. I believe Powershell can resolve that on Windows as well. Will check.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bgelens picture bgelens  路  6Comments

catthehacker picture catthehacker  路  4Comments

Cruik picture Cruik  路  9Comments

firlus picture firlus  路  10Comments

MJECloud picture MJECloud  路  6Comments