Skip to content

Latest commit

 

History

History
144 lines (96 loc) · 3.05 KB

File metadata and controls

144 lines (96 loc) · 3.05 KB
title Windows Terminal Setup
description Configurazione completa di Windows Terminal: temi, font, profili e personalizzazioni
icon 💻
tag Tutorial
date 2026-01-05

import InfoBox from '../../components/InfoBox.astro'; import StepHeader from '../../components/StepHeader.astro';

Guida per configurare PowerShell 7 con autocompletamento, Oh My Posh e icone


winget install Microsoft.PowerShell

Chiudi e riapri Windows Terminal. Ora vedrai "PowerShell" come nuovo profilo.


Apri PowerShell 7 come amministratore ed esegui:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Conferma con Y quando richiesto.


winget install JanDeDobbeleer.OhMyPosh

Testa che funzioni:

oh-my-posh init pwsh | Invoke-Expression

Necessario per visualizzare le icone nel prompt:

oh-my-posh font install

Scegli CaskaydiaCove o FiraCode.

Vai in Windows Terminal → Settings → Profiles → Defaults → Appearance → Font face e seleziona il font installato (es. "CaskaydiaCove Nerd Font").
Install-Module -Name Terminal-Icons -Repository PSGallery -Force

Questo file viene eseguito ad ogni avvio di PowerShell:

New-Item -Path $PROFILE -Type File -Force
notepad $PROFILE

Contenuto del $PROFILE

# Oh My Posh
oh-my-posh init pwsh | Invoke-Expression

# PSReadLine - Autocompletamento
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward

# Terminal Icons
Import-Module Terminal-Icons

Copia questo contenuto nel file e salva.


In Windows Terminal: Settings → Startup → Default profile → seleziona "PowerShell"

In VS Code: Apri settings.json e aggiungi:

{
    "terminal.integrated.defaultProfile.windows": "PowerShell"
}

Chiudi tutto e riapri Windows Terminal. Verifica con:

# Versione PowerShell (deve essere 7.x)
$PSVersionTable.PSVersion

# Versione PSReadLine (deve essere 2.2+)
Get-Module PSReadLine
Se PSReadLine non supporta `-PredictionSource`, aggiornalo manualmente:
Install-Module PSReadLine -Force -SkipPublisherCheck

Setup testato su Windows 11 con PowerShell 7