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

Icons render as number in powershell constrianed mode #138

Open
ocalvo opened this issue Aug 6, 2024 · 0 comments
Open

Icons render as number in powershell constrianed mode #138

ocalvo opened this issue Aug 6, 2024 · 0 comments

Comments

@ocalvo
Copy link

ocalvo commented Aug 6, 2024

In constrained mode the global $glyphs variable is not evaludated.

Expected Behavior

Glyphs to show correctly after the module is loaded.

Current Behavior

Glyphs shows as a number instead of as an icon.

Possible Solution

Use Invoke-Expression to evaluate the $glyphs varaible.
Here is a workaround:

Import-Module Terminal-Icons
if ($null -eq $global:glyphs) {
  $glPath = Split-path (get-module Terminal-Icons).Path
  $global:glyphs = Invoke-Expression "& '$glPath/Data/glyphs.ps1'"
}

Steps to Reproduce (for bugs)

  1. Set powershell in constrained mode.
  2. Load Terminal-Icons (Notice evaluation error)
  3. Dir a folder.

Context

Your Environment

  • Module version used:
  • Operating System and PowerShell version:
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

1 participant