Windows Terminal – installation et personnalisation

Introduction

Windows lance un nouveau terminal de saisie de commande qui va permettre de fusionner les shell classiques :

  • cmd
  • PowerSheel
  • Windows Subsystem for Linux (WSL)

Ce nouvel outil est un concurrent direct à Terminal Cmder

Installation

  1. Lancer Windows Store
microsoft store
  1. Rechercher et installer Windows Terminal
install windows terminal

Ajouter github bash

settings.json windows terminal

Modifier settings.json

{
"guid": "{00000000-0000-0000-ba54-000000000002}",
"acrylicOpacity" : 1,
"closeOnExit" : true,
"colorScheme" : "Campbell",
"commandline" : "\"%PROGRAMFILES%\git\usr\bin\bash.exe\" -i -l",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace" : "Consolas",
"fontSize" : 12,
"historySize" : 9001,
"icon" : "C:\Program Files\Git\mingw64\share\git\git-for-windows.ico",
"name" : "GitBash",
"padding" : "0, 0, 0, 0",
"snapOnInput" : true,
"startingDirectory" : ".",
"useAcrylic" : true
}

Modifier le terminal par défaut

Modifier la propriété defaultProfile du fichier settings.json et lui attribuer le guid du shell par défaut

Modifier settings.json

{
  "$schema": "https://aka.ms/terminal-profiles-schema",
  "defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"
}

Ajouter Windows terminal aux raccourcis disponibles sur le clique droit

Le dossier en cours

  1. Modifier settings.json
"startingDirectory" : "."

à la place de %USERPROFILE% pour chaque profil

Modifier la base de registre

  1. Créer le fichier wt.reg
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Open Windows Terminal here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="C:\Users\<User>\AppData\Local\Microsoft\WindowsApps\wt.exe"
  1. Attention mettre le nom du <User> correspondant à votre système
  2. Double cliquer sur le fichier et accepter la modification de base de registre de l’OS :
regedit windows terminal
regedit windows terminal validé
  1. la base de registre est mise à jour (saisir regedit)

Ajouter une image sur le clique droit

  1. Télécharger l’icone terminal.ico
  2. Créer le dossier WTerminal dans le dossier AppData
%USERPROFILE%/AppData/Local/
  1. Modifier la base de registre en saisissant la commande regedit
HKEY_CLASSES_ROOT\Directory\Background\shell\wt
regedit add icon
  1. Pour le paramètre Icon ajouter
%USERPROFILE%/AppData/Local/WTerminal/terminal.ico

Clique droit opérationnel

right click Open Windows Terminal here

Palette des commandes

Le terminal dispose d’un menu permettant d’accéder à des options comme :

  1. Fractionner le terminal en manière horizontale ou vertical
  2. Définir une couleur pour les onglets
  3. Rechercher
  4. Changer d’onglet

via le raccourci Ctrl + Shift + p

Pour activer ce menu, il faut ajouter dans le fichier settings.json :

"keybindings":[
  // .....
  { "command": "commandPalette", "keys": "ctrl+shift+p" }
]

Ailleurs sur le web