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

Errors while using with PowerShell Core on Mac #18

Closed
genebean opened this issue Jun 9, 2017 · 5 comments
Closed

Errors while using with PowerShell Core on Mac #18

genebean opened this issue Jun 9, 2017 · 5 comments

Comments

@genebean
Copy link

genebean commented Jun 9, 2017

Ran into the problems below while trying this out on my Mac with the latest version of PowerShell:

PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

cdLoading personal and system profiles took 827ms.

PS /Users/gene.liverman> $PSVersionTable.PSVersion

Major Minor Patch Label
----- ----- ----- -----
    6     0     0 beta

PS /Users/gene.liverman> Install-Module PowerLine -Scope CurrentUser

Untrusted repository 
You are installing the modules from an untrusted repository. If you trust this repository,
change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you
sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y

PS /Users/gene.liverman> Get-Module -ListAvailable PowerLine


    Directory: /Users/gene.liverman/.local/share/powershell/Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.3.1      PowerLine                           {Set-PowerLinePrompt, Add-PowerLineBlock, New-TextFactory, Get-Elapsed...}


PS /Users/gene.liverman> using module PowerLine
Exception calling "EnableVirtualTerminalProcessing" with "0" argument(s): "The type initializer for 'PoshCode.Pansies.Console.WindowsHelper' threw an exception."
    + CategoryInfo          : InvalidOperation: (/Users/gene.liv.../PowerLine.psd1:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : TypeInitializationException,Microsoft.PowerShell.Commands.ImportModuleCommand

PS /Users/gene.liverman> $PowerLinePrompt = @(
>>         @{ bg = "Cyan";     fg = "White"; text = { $MyInvocation.HistoryId } }
>>         @{ bg = "DarkBlue"; fg = "White"; text = { $pwd } }
>>     )

PS /Users/gene.liverman> Set-PowerLinePrompt -PowerLineFont 
The property 'UseAnsiEscapes' cannot be found on this object. Verify that the property exists and can be set.
At /Users/gene.liverman/.local/share/powershell/Modules/PowerLine/2.3.1/PowerLine.psm1:420 char:5
+     $global:PowerLinePrompt.UseAnsiEscapes = $UseAnsiEscapes
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException

The property 'RestoreVirtualTerminal' cannot be found on this object. Verify that the property exists and can be set.
At /Users/gene.liverman/.local/share/powershell/Modules/PowerLine/2.3.1/PowerLine.psm1:421 char:5
+     $global:PowerLinePrompt.RestoreVirtualTerminal = $RestoreVirtualT ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException

PS>
@TylerLeonhardt
Copy link

Run into this too on macOS :(

@Jaykul
Copy link
Owner

Jaykul commented Dec 11, 2018

This is a bug in PANSIES, obviously (not in PowerLine), but I'll leave this open to make sure I don't forget to deal with it. PANSIES is supposed to be cross-platform.

I think you just need to use an older version of PANSIES -- the pre-releases are kind-of Windows only (and I'm OK with that).

@ExE-Boss
Copy link
Contributor

There is also #52, which is caused by PowerShell/PowerShell#10092.

@Jaykul
Copy link
Owner

Jaykul commented Oct 26, 2019

And apparently #44

@Jaykul
Copy link
Owner

Jaykul commented Jul 14, 2021

I believe all of these are fixed now.

Since this is all very old, I'm going to assume people are as bad as I am about noticing notifications from github, and I'm going to close it without confirming with all of the reporters. If there are more cross-platform bugs, let's open new issues ;-)

@Jaykul Jaykul closed this as completed Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants