Skip to content

Icons render as number in powershell constrianed mode #138

@ocalvo

Description

@ocalvo

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions