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

Migrating to Nerd Font v3 #104

Merged
merged 4 commits into from
Jun 1, 2023
Merged

Migrating to Nerd Font v3 #104

merged 4 commits into from
Jun 1, 2023

Conversation

Tiberriver256
Copy link
Contributor

@Tiberriver256 Tiberriver256 commented May 10, 2023

  • glyphs.ps1 has been updated with new glyphs
  • The devblackops.psd1 icon theme has been updated with new glyphs
  • Invoke-TerminalIconsThemeMigration has been added to help users with the migration

Before

image

After

image

I don't think this is quite ready to merge yet but I wanted to get this PR up to get some feedback on it. It should take care of #101 and #103 when it's merged.

- glyphs.ps1 has been updated with new glyphs
-devblackops.psd1 icon theme has been updated with new glyphs
-Invoke-TerminalIconsThemeMigration has been added to help users with the migration
@codeleverage
Copy link

Hey @Tiberriver256 I found a few more locations of hard-coded broken glyphs (mostly in documentation)

..\Terminal-Icons\docs\en-US\Set-TerminalIconsIcon.md
Line 55: Set-TerminalIconsIcon -FileExtension ".xml" -Glyph "nf-mdi-file_xml"
Line 62: Set-TerminalIconsIcon -Directory ".github" -Glyph "nf-mdi-github_face"
Line 69: Set-TerminalIconsIcon -Glyph "nf-mdi-xml" -NewGlyph "nf-mdi-file_xml"
Line 72: Changes all uses of the "nf-mdi-xml" double-wide glyph to be the "nf-mdi-file_xml"
..\Terminal-Icons\Terminal-Icons\Private\Resolve-Icon.ps1
Line 44:                 $displayInfo['Target'] = ' ' + $glyphs['nf-mdi-arrow_right_thick'] + ' ' + $FileInfo.Target
Line 58:                 $displayInfo['Target'] = ' ' + $glyphs['nf-mdi-arrow_right_thick'] + ' ' + $FileInfo.Target
..\Terminal-Icons\Terminal-Icons\Public\Set-TerminalIconsIcon.ps1
Line 30:         PS> Set-TerminalIconsIcon -FileExtension ".xml" -Glyph "nf-mdi-file_xml"
Line 34:         PS> Set-TerminalIconsIcon -Directory ".github" -Glyph "nf-mdi-github_face"
Line 38:         PS> Set-TerminalIconsIcon -Glyph "nf-mdi-xml" -NewGlyph "nf-mdi-file_xml"
Line 40:         Changes all uses of the "nf-mdi-xml" double-wide glyph to be the "nf-mdi-file_xml"

Here's the code I ran from the root of the repo in case it's useful to find any other glyph references

Get-ChildItem -Recurse -File |
  Where-Object { $_.Name -ne 'Invoke-TerminalIconsThemeMigration.ps1' } |
  ForEach-Object {
    $index = 0
    $lines = @(
      Get-Content -LiteralPath $_.FullName |
        Where-Object { $_.Contains('nf-mdi-'); $index += 1 } |
        ForEach-Object { 'Line {0}: {1}' -f $index, $_ }
    )
    if ($lines.Count -gt 0) {
      Write-Host $_.FullName -ForegroundColor Red
      $lines | Write-Host
    }
  }

@Tiberriver256
Copy link
Contributor Author

Good catch @codeleverage. Ironically the Invoke-TerminalIconsThemeMigration.ps1 file works for any text file so I just had to run it on all the ps1 and markdown files haha.

@ev-dev
Copy link

ev-dev commented May 12, 2023

Nice work @Tiberriver256, I was real glad to see this was already in progress after I unexpectedly broke a bunch of my devtools this morning from upgrading to NFv3!

Wanted to mention that I found it helpful to use each glyph's Unicode hex (ex. $GitIcon = "`u{f02a2}") instead of the literal icons in my scripts and terminal/IDE configs. The hex codes were easier to visually compare/copy across different apps without seeing any broken character renderings as I made changes.

Any reason to think that could be beneficial to do here as well? Would using the hex codes make the hard-coded glyph definitions easier to maintain in future NF code point changes?

PSA/Note-to-self: good reminder to take >30sec to review system package changes before blindly upgrading all (like I did and broke things just as I needed to do work 🙃)

@ev-dev
Copy link

ev-dev commented May 12, 2023

Actually, I just noticed in the MS docs that the Unicode escape sequence feature was introduced in PowerShell v6, which probably takes that option off the table if this project is in use by people running it in older Windows PowerShell versions 🤷‍♂️

@Tiberriver256
Copy link
Contributor Author

Thanks for the suggestion! The Glyphs.ps1 file wasn't the tough part of this PR. There's a task in the psakeFile.ps1 file in the root for automatically re-generating it from the HTML on the cheat sheet. The tricky part was that the class names changed, and several were removed.

@devblackops devblackops self-requested a review May 16, 2023 02:26
@devblackops devblackops added the enhancement New feature or request label May 16, 2023
Copy link
Owner

@devblackops devblackops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @Tiberriver256. I haven't seen this issue because I haven't messed with NF v3 yet. I'll do that and review this and the migration process.

build.ps1 Outdated Show resolved Hide resolved
Removing #requires statement
@Tiberriver256 Tiberriver256 requested a review from devblackops May 16, 2023 13:15
@AndreM222
Copy link

terminal icons have not updated itself to work yet for the new nerd fonts update right?

@Tiberriver256
Copy link
Contributor Author

Yep, until this PR merges you'll want to still be using 2.x version of Nerd Fonts if you can.

@Tiberriver256
Copy link
Contributor Author

This should be ready for another build attempt whenever you get the chance @devblackops

@AndreM222
Copy link

lets pray to god @devblackops to merge the update 🙏

@devblackops
Copy link
Owner

Looks good @Tiberriver256. Thanks for the fix!

@devblackops devblackops self-assigned this Jun 1, 2023
@devblackops devblackops merged commit 3ce0651 into devblackops:main Jun 1, 2023
@SvenAelterman
Copy link

May I ask how the update will be made available for PS? I think perhaps by doing Update-Module Terminal-Icons and then the new Invoke-TerminalIconsThemeMigration cmdlet?

@Tiberriver256
Copy link
Contributor Author

If you use the out-of-the-box theme, you won't have to do anything other than get the latest version from PowerShell Gallery with Update-Module. If you have your custom icons theme file, you'll want to use the Invoke-TerminalIconsThemeMigration cmdlet to migrate the icons in that theme file.

@AndreM222
Copy link

There are still some icons which are not being loaded. Do I have to wait for some time as for the update to be enabled or am I already in the latest?
image

@Tiberriver256
Copy link
Contributor Author

@AndreM222 Although the PR has merged, a new release has not been made yet. Once you see a new release pop up on the releases page here, you should be able to pick it up using Update-Module.

@its-monotype
Copy link

@AndreM222 Although the PR has merged, a new release has not been made yet. Once you see a new release pop up on the releases page here, you should be able to pick it up using Update-Module.

Is there any way to set a notification for the new release 😂?

@Tiberriver256
Copy link
Contributor Author

It looks like devblackops also uses Github releases, so you should be able to set a notification for one of those.

On the home page for the Terminal Icons repo -> Click watch -> click custom

In the custom menu -> select releases -> click apply

@AndreM222
Copy link

Its still in dev right?

@GMedlin
Copy link

GMedlin commented Jun 23, 2023

Would love to have this released!

@fluentmoheshwar
Copy link

@devblackops release this asap!!

@SvenAelterman
Copy link

@devblackops release this asap!!

Please?

@its-monotype
Copy link

@devblackops

@devblackops
Copy link
Owner

v0.11.0 has been released! 🎉

Sorry I've been sitting on this for so long. Life has been busy and I've been neglecting my OSS stuff. I'll try my best to keep on top of it from now on.

@fluentmoheshwar
Copy link

v0.11.0 has been released! 🎉

Sorry I've been sitting on this for so long. Life has been busy and I've been neglecting my OSS stuff. I'll try my best to keep on top of it from now on.

It's okay! Thank you so much for publishing it <3

@Tiberriver256
Copy link
Contributor Author

Reminder: if you like this library, send devblackops a coffee or something using the GitHub sponsor feature. It's a lot of work to maintain stuff like this.

@AndreM222
Copy link

v0.11.0 has been released! 🎉

Sorry I've been sitting on this for so long. Life has been busy and I've been neglecting my OSS stuff. I'll try my best to keep on top of it from now on.

Thanks man we really apreciate it. Great stuff 😊

daniel-liuzzi added a commit to daniel-liuzzi/dotfiles that referenced this pull request Oct 22, 2023
cdonnellytx pushed a commit to cdonnellytx/Terminal-Icons that referenced this pull request Jan 24, 2024
* Migrating to Nerd Font v3
  - glyphs.ps1 has been updated with new glyphs
  -devblackops.psd1 icon theme has been updated with new glyphs
  -Invoke-TerminalIconsThemeMigration has been added to help users with the migration
* Fixing docs and additional files
* Added missing documentation for parameters

---------

Co-authored-by: Micah Rairdon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants