Tips | Customizando o seu terminal PS
E ae, pessoal, beleza? Falando hoje sobre um pacote bem legal desenvolvido por Brandon Olin. O Terminal-Icons proporciona uma interface amigável que no terminal não é padrão deste tipo de aplicação.
Esse projeto é bem legal pra dar um pouco mais de visibilidade para os arquivos quando estamos no modo terminal, ele utiliza o projeto NERD FONTS.
No link abaixo temos um passo a passo para que a fonte seja reconhecida e funcione no nosso terminal.
Note: since version 0.1.1 of the module this now works in Windows PowerShell or PowerShell Core.
- Download and install this version of Literation Mono Nerd Font which has been specifically fixed to be recognised as monospace on Windows:
(see this issue for more info: ryanoasis/nerd-fonts#269)
- Modify the registry to add this to the list of fonts for terminal apps (cmd, powershell etc.):
$key = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont'
Set-ItemProperty -Path $key -Name '000' -Value 'LiberationMono NF'
-
Open PowerShell, right click the title bar > properties > Font > select your new font from the list.
-
Install and load Terminal-Icons:
Install-Module Terminal-Icons -Scope CurrentUser
Import-Module Terminal-Icons
Result:

Obs: se você utiliza o terminal integrado do Visual Studio code a fonte não é reconhecida infelizmente 😫, porém abrindo o terminal é sucesso 😍 tudo funciona perfeitamente utilizando a fonte correta 😄.
Para teste criei alguns arquivos vazios, segue abaixo o script que utilizei para criar a massa de arquivos:
$ListaExtensoes = (".sql",".js",".css",".html",".cs",".cpp",".java",".go",".py",".php",".r",".ps1") | |
New-Item -Path $home\desktop -Name "terminal-icon" -ItemType Directory -Force | |
foreach($file in $ListaExtensoes){ | |
New-Item -Path "$home\desktop\terminal-icon" -Name "teste-teminalicon$file" -Value $null -ItemType File -Force | |
} | |
Install-Module -Name Terminal-Icons -Repository PSGallery | |
Import-Module -Name Terminal-Icons | |
➕ Demo CentOS:
Fiz o download da mesma fonte LiberationMono após a instalação alterei no meu terminal para utiliza-la e a mágica acontece 🎉.

É isso pessoal, não se esqueça, PS é vida ❤️
Top comments (2)
Ótimo post me ajudou muito, consegui configurar no vscode colocando nas configurações do usuário para colocar a fonte no terminal com: "terminal.integrated.fontFamily": "'LiterationMono NF'",
You should give PowerType a try it gives you suggestions for common tools like git and non.