Terminal-Icons
Terminal-Icons copied to clipboard
[bug/show-terminaliconstheme] Command displays default file icon on folders
Expected Behavior
Executing the command should display the themed folder icons.
Current Behavior
Executing the command renders correctly the file icons but treats folders as files, displaying the default file icon.
The issue is not experienced in normal use:
Possible Solution
I think the problem could be in Resolve-Icon.ps1, following step by step the code execution running the commands by hand in the terminal, I couldn't find the PSIsContainer attribute on $FileInfo, maybe it skips to the type of file because of that. I still have to figure out why it does not occur in normal use.
My poor attempt to figure out the problem 😅:
As you can see nothing is returned, and it didn't autocomplete. (The smaller image is the expected custom one) The piece of code I think is responsible for the bug:
if ($FileInfo.PSIsContainer) { <----- PSIsContainer not present
$type = 'Directories'
} else {
$type = 'Files'
}
Steps to Reproduce (for bugs)
- Import-Module Terminal-Icons
- Show-TerminalIconsTheme
Context
I'm using the command to debug the icon theme I'm creating.
Your Environment
- OS: Microsoft Windows 11
- Terminal Emulator: Windows Terminal, PowerShell 7.4.0
- Terminal-Icons Module Version: 0.11.0