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

Host.ui.rawui.foregroundcolor/backgroundcolor are not set on mac #47

Open
plastikfan opened this issue Feb 7, 2021 · 2 comments
Open
Assignees
Labels
bug Something isn't working chore Non source related, infrasture change

Comments

@plastikfan
Copy link
Collaborator

plastikfan commented Feb 7, 2021

this causes errors when trying to write in colour.

The following code in Krayon constructor cause error, because for some reason it is set to -1:

    $this._defaultFgc = (Get-Host).ui.rawui.ForegroundColor;
    $this._defaultBgc = (Get-Host).ui.rawui.BackgroundColor;

This appears to be a problem in PowerShell.

On mac:

λ $host.ui.RawUI.ForegroundColor
-1


λ (get-host).ui.rawui | Format-List -Property *

ForegroundColor       : -1
BackgroundColor       : -1
CursorPosition        : 0,52
WindowPosition        : 0,0
CursorSize            : 100
BufferSize            : 214,53
WindowSize            : 214,53
MaxWindowSize         : 214,53
MaxPhysicalWindowSize : 214,53
KeyAvailable          : False
WindowTitle           :

On windows:

λ (get-host).ui.rawui | Format-List -Property *

ForegroundColor       : Gray
BackgroundColor       : Black
CursorPosition        : 0,59
WindowPosition        : 0,0
CursorSize            : 25
BufferSize            : 213,60
WindowSize            : 213,60
MaxWindowSize         : 213,60
MaxPhysicalWindowSize : 1904,70
KeyAvailable          : True
WindowTitle           : Elizium.Krayola
@plastikfan plastikfan added the chore Non source related, infrasture change label Feb 7, 2021
@plastikfan plastikfan self-assigned this Feb 7, 2021
@plastikfan
Copy link
Collaborator Author

This is being tracked under PowerShell issue: ui.RawUI on result of 'Get-Host' contains ForegroundColor/BackgroundColor set to -1 on macOS

@plastikfan plastikfan added the bug Something isn't working label Feb 8, 2021
@plastikfan
Copy link
Collaborator Author

Leaving this issue open purely to track the underlying issue.

@plastikfan plastikfan reopened this Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Non source related, infrasture change
Projects
None yet
Development

No branches or pull requests

1 participant