microsoft/terminal

Document shell icons and their paths

bitcrazed opened this issue ยท 39 comments

It'd be awesome if the docs for profiles.json included a table enumerating the icons included in the Terminal and their paths.

For example, it's highly non-intuitive that the PowerShell icon is "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png" whereas the icon for Cmd is "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png".

What, therefore, is the path to the PowerShell Core icon?

These aren't really intended to be used by users. They exist to support dynamic profile generation. When we have a settings UI, you can just select from a palette of icons.

Either way, we should document these icons' guids.

I profoundly disagree! They're an implementation detail, not an implementation on their own!

kshji commented

I like to see documented palette of icons - which I can select to tell me tab using. Example current Ubuntu bash icon is not same as I use directly wsl bash, like to change it. It would be nice to see set of icons which user like to select to tell meaning of tab. Same way as you setup ex. favicon in netsite/tab.
In "real" program you can setup icon from set of icons. But this "apps" you can't ? Ex. I like to set some icon to this Window Terminal which are not so much as PS cmd window has been.

ffes commented

Since @DHowett-MSFT doesn't want to document them, and we (the users) don't have a UI at the moment and I was curious what icons I could use, I searched and found https://github.com/microsoft/terminal/tree/master/src/cascadia/CascadiaPackage/ProfileIcons

There you have the 5 GUIDs that are available at the moment ๐Ÿ˜‰

It's also possible to use ordinary URL:s. For example, I added Git bash and used this git logo URL for "icon".

@md2perpe We'd recommend referring to local files, NOT URLs - the latter may take considerable amounts of time to retrieve (if at all) and since the image you refer to is quite large, it'll take a noticeable amount of time for it to be reduced down to 32x32px. Combined, this will likely result in a poor experience, and perhaps intermittent "disappearing" icons.

To add to that, you probably don't want to be making a web request to a remote server every time you launch Terminal. ๐Ÿ˜„

@ffes While I agree to some point, as stated here:

Note: Do not rely on the files referenced by the ms-appx URI Scheme - they are considered an internal implementation detail and may change name/location or may be omitted in the future.

We're going to be working on a settings UX in the future, but for now if you want to use specific icons, we encourage you to create & refer to your own icon collection.

For others' future reference, I added a line to my profiles.json file:

"icon": "file:///c:/users/<username>/icons/bash_logo_32x32.png"

This points to an icon file in a completely different folder than whatever ms:///appx points to, and it worked once I saved the profile. I didn't even have to reload the program for it to apply.

This was on Windows Terminal (Preview) Version: 0.9.433.0, so of course it might change (or have some future interface override it), but it's probably going to work this way for the foreseeable future through v1.0.

Can confirm the process outlined by @kjmitch works in 1.0; I don't know if this is intended behaviour but when displaying a PNG the terminal won't keep the transparency but rather use a white background.

Well, uh, all of the PNGs that come with terminal have transparency in them. . .

FWIW, I keep a folder called "WindowsTerminal" in my OneDrive in which I stash all the icons and background images for the shells etc. that I use, and which are automatically synchronized across all my machines.

image

Then in my settings.json, I just need to specify "%USERPROFILE%/OneDrive/WindowsTerminal/... to reach any of those files.

This makes it MUCH easier to keep my profiles tuned just the way I like them.

Bonus tip: Once I have my settings the way I like them, I also keep a backup copy in the aforementioned OneDrive folder so I can just copy it onto new/re-paved machines.

@Devilmoon - I bet if you open your PNG in Paint.NET, you'll find that it has a white background. If it's transparent, you'll see a gray and white chequerboard pattern indicating areas of transparency.

You can use Paint.Net's magic wand & selection tools to select & delete white areas, revealing the transparency chequerboard - see left hand side of Dustin's profile image here ๐Ÿ˜œ:

image

@bitcrazed Yes, that seemed to be the case even though I had downloaded what seemed like a transparent PNG image from Google. However after manually removing the background it now works as expected.

FWIW, I keep a folder called "WindowsTerminal" in my OneDrive in which I stash all the icons and background images for the shells etc. that I use, and which are automatically synchronized across all my machines.

image

Then in my settings.json, I just need to specify "%USERPROFILE%/OneDrive/WindowsTerminal/... to reach any of those files.

This makes it MUCH easier to keep my profiles tuned just the way I like them.

Bonus tip: Once I have my settings the way I like them, I also keep a backup copy in the aforementioned OneDrive folder so I can just copy it onto new/re-paved machines.

FYI @bitcrazed : I really liked your idea, but when I used this in my office environment, this didn't get resolved correctly--probably due to folder redirection or some such. But, what I can use everywhere is "%OneDrive%/WindowsTerminal/... Thanks.

Hey @JimF42 - thanks for the tip - if you configure OneDrive for Business on your machine, then %ONEDRIVE% points there, not to your personal OneDrive.

Looks like one could also use %ONEDRIVECOMMERCIAL% and %ONEDRIVECONSUMER% too:
image

Updating my settings.json now :)
image

Where is the Windows terminal icon itself located?

Yes! But where is its location on the windows installation?

Windows Terminal is a modern, packaged app. All packaged apps are installed by the Windows packaged app installation engine into the protected C:\Program Files\WindowsApps\<app> folders.

Because it's a modern app, Windows Terminal doesn't contain an .ico icon file per se., but instead contains several multi-resolution images in the app's images folder.

May I ask why you're trying to file Terminal's icon/tile image files on disk?

@bitcrazed I, personally, want to set the icon to a shortcut I made to C:\Users\nacho\AppData\Local\Microsoft\WindowsApps\wt.exe. I do not use Windows 10 style pinned apps and prefer the Windows 7 style Quick Launch folder in my taskbar. But the wt.exe shortcut doesn't have the Windows Terminal icon -- it has the default/generic one. So I am trying to find the Windows Terminal .ico file so I can set the icon in my shortcut.

The default icons that Windows Terminal is using is here: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_#####

To get into the WindowsApps folder you will need permission. However, if you do not want to mess with permissions, you can do the following.

  1. Open the Windows Terminal App
  2. Click the drop-down arrow.
  3. alt+click settings -that opens the default .json file
    I would recommend opening it up in VS Code
  4. Right click the tab and click "Reveal In File Explorer"
  5. The icons are located in the ProfileIcons

To use these icons keep the ms-appx:///ProfileIcons/ then just add the icon name and extension. However, to add your own icons to the folder, you will need permission.

We reserve the right to change the names of and paths to these icons.

@zooboo44 Thanks! I appreciate it. I was looking for the main icon for terminal icon, the one with >_, in an .ico format. I don't need the specific terminal type icons. But I was able to use C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_####\wt.exe to get to it. Thanks~

@DHowett Got it.

FWIW, I keep a folder called "WindowsTerminal" in my OneDrive in which I stash all the icons and background images for the shells etc. that I use, and which are automatically synchronized across all my machines.

image

Then in my settings.json, I just need to specify "%USERPROFILE%/OneDrive/WindowsTerminal/... to reach any of those files.

This makes it MUCH easier to keep my profiles tuned just the way I like them.

Bonus tip: Once I have my settings the way I like them, I also keep a backup copy in the aforementioned OneDrive folder so I can just copy it onto new/re-paved machines.

Do you keep these icons on github or share somewhere? Don't feel like fetching and googling to get all these icons. I thought the terminal would have some default ones to use.

waf commented

I've uploaded a collection of icons here: https://github.com/PacktPublishing/Windows-Terminal-Tips-Tricks/tree/main/Chapter%2004 (in the icons subdirectory).

@waf Nice, I also had done the same a while back.

https://github.com/TheFern2/windows-terminal-icons

Please, give me an advice I customized the PowerShell icon, but was not good, I now need to restore the former (default) icon. Where can I found the default PowerShell icon?

@sdudnic If you just delete the icon set for your Windows PowerShell profile, it should fall back to the default one.

@sdudnic If you just delete the icon set for your Windows PowerShell profile, it should fall back to the default one.

and the default one is take from the PowerShell .exe directly?

and the default one is take from the PowerShell .exe directly?

More or less? It's not the exact .ico file, but I believe it's a .png version.

I profoundly disagree! They're an implementation detail, not an implementation on their own!

I just installed WSL Ubuntu and it added a profile to WindowsTerminal with an icon path of ms-appx:///ProfileIcons/[guid].png. That's cool and all, but what if I decided to switch the icon and then decided I liked the default after all. I wouldn't know how to reference that path.

In 1.11 and above, you can do this:

image

image

The best thing about the devs seeing this thread is they can see how much work users are putting into collating and distributing icon sets to share, because there was no way for them to have a repository that could just let the user select an icon from some sort of dropdown or file browsing prompt.
/s

The thing that actually annoys me the most is that my icons broke after either Kali or Ubuntu updated, and now they default to the linux icon. Finding the URIs for the original icons seems impossible in the settings as of right now.

The default icons are useful to users who need them. For example, I use Yori(a modern CMD replacement), whose prompts can be customized like any modern shell(PowerShell, Z shell) with modern features like tab completion and can also function as a replacement of cmd. I set it to the default cmd icon ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png.
But in Windows 11 when I open a bat file with Windows Terminal it uses some default cmd profile to run that script and uses this icon
image
What is this icon and where can I find it?

Ah, good eye, the docs should be updated.

If there's no icon specified, we'll fall back to this glyph from Segoe Fluent:

Glyph Unicode point Description
  e756 CommandPrompt
qJake commented

I came here after seeing the glyph from Segoe Fluent, seeing that it was just a text value, copying+pasting it, finding out its Unicode value, and then googling for what U+E756 was.

This is actually a super useful trick! If you can copy the actual Unicode character for one of the glyphs in the Segoe Fluent font, you can have crisp, matching icons for all your profiles. For example, if you copy the actual character U+EA18 (use PS or an online tool) onto your clipboard and paste it into the icon setting textbox in Terminal's Profile Settings, you correctly get a shield:

image

Neat!

Edit: This makes me want to PR a feature where there's a dropdown of all of these icons, so you can choose one from a list or gallery instead of typing it in by hand. Would be awesome!