Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Fails to run if installed path contains special characters #456

Closed
2 tasks done
felipecrs opened this issue Feb 25, 2021 · 5 comments
Closed
2 tasks done

Fails to run if installed path contains special characters #456

felipecrs opened this issue Feb 25, 2021 · 5 comments
Labels
🐛 bug Something isn't working

Comments

@felipecrs
Copy link

Prerequisites

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

Description

I installed oh-my-posh with Install-Module oh-my-posh -AllowPrerelease -Force, and it fails to run as:

$ Set-PoshPrompt
&: The term 'C:\Users\felipesantos\OneDrive - Instituto Nacional de Telecomunicações\Documents\PowerShell\Modules\oh-my-posh\3.97.2\bin\posh-windows-amd64.exe' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Invoke-Expression: Cannot bind argument to parameter 'Command' because it is an empty string.

It seems to be because the binary path is not right. It was supposed to be:

C:\Users\felipesantos\OneDrive - Instituto Nacional de Telecomunicações\Documents\PowerShell\Modules\oh-my-posh\3.97.2\bin\posh-windows-amd64.exe

So there must be something wrong while parsing it.

Environment

  • Oh my Posh version: 3.97.2
  • Theme: doesn't matter
  • Operating System: Windows 10 21H1
  • Shell: PowerShell 7.1.2
  • Terminal: Windows Terminal Preview 1.6

Steps to Reproduce

Probably try to install in a system where the Documents folder is backed up with OneDrive for Business, and the company name has special characters.

Expected behavior: The commands to work.

Actual behavior: No posh commands works.

@JanDeDobbeleer
Copy link
Owner

Tried it on macOS and Windows, works as expected.

Windows

image

macOS

image

Can you check the encoding in your terminal? As that might have this effect. Ideally PSCore defaults to UTF8 as identified here. A fix is to add this to your $PROFILE: [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding

@JanDeDobbeleer JanDeDobbeleer added the 🐛 bug Something isn't working label Feb 25, 2021
@felipecrs
Copy link
Author

image

That works. I'll add it to my profile.

@felipecrs
Copy link
Author

BTW:

IsSingleByte      : True
EncodingName      : OEM United States
WebName           : ibm437
HeaderName        : ibm437
BodyName          : ibm437
Preamble          :
WindowsCodePage   :
IsBrowserDisplay  :
IsBrowserSave     :
IsMailNewsDisplay :
IsMailNewsSave    :
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : False
CodePage          : 437

@JanDeDobbeleer
Copy link
Owner

The problem is that I could add that to oh-my-posh, but I'm afraid that might introduce other side-effects for people.

@felipecrs
Copy link
Author

I totally understand. For me, it's ok to keep it in my profile. It doesn't seem the kind of problem to be solved here, but in the Powershell Core itself, most likely.

Repository owner locked and limited conversation to collaborators Feb 26, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants