Windows terminal

Découvrir le nouveau terminal de Windows, bien plus ergonomique que PowerShell.

Écrit par Ewilan Rivière

Le Windows terminal est un nouveau terminal fait par Microsoft qui remplace avantageusement le PowerShell classique avec un design bien plus ergonomique et des options plus facilement modifiables, ce terminal se rapproche beaucoup des terminaux de Linux de part son aspect user-friendly.

GitHub: microsoft/terminal

Fonctionnalités

  • Onglets
  • Configuration facile avec un simple .json
  • Multi-profils de Shell (intègre WSL s'il est installé)
  • Raccourcis configurables

1. Installation

1. a. Windows Store

Sur le Windows Store, rechercher windows terminal et vous devrez trouver cela résultat Windows terminal. Téléchargez-le et le terminal sera disponible depuis vos applications.

1. b. Scoop

Si vous n'avez pas accès au Windows Store, vous pouvez l'installer avec Scoop, un gestionnaire de paquets pour Windows dont l'installation est expliquée dans cet article

scoop bucket add extras
scoop install windows-terminal

2. Configuration

Lancez l'application et vous découvrirez le nouveau terminal de Windows avec ses onglets très utiles quand on fait du développement. N'hésitez pas à cliquer sur , à côté du bouton ouvrant un nouvel onglet : + et sélectionnez Paramètres (Ctrl+,) pour ouvrir le fichier .json de configuration. Toute modification sera appliquée directement.

Vous pourrez trouver des informations sur la manière de configurer ce fichier dans la documentation du dépôt GitHub mais voici un exemple de configuration possible :

{
  // ...

  "defaultProfile": "{79285a8e-036c-446f-8a9c-78994e34bf78}",

  "profiles": [
    // ...
    {
      "acrylicOpacity": 0.8,
      "background": "#000000",
      "backgroundImage": "C:/background-img-path",
      "backgroundImageOpacity": 0.7,
      "backgroundImageStretchMode": "uniformToFill",
      "closeOnExit": false,
      "colorScheme": "Konsole",
      "commandline": "powershell.exe",
      "cursorColor": "#00FF00",
      "cursorHeight": 25,
      "cursorShape": "vintage",
      "fontFace": "Fira Code",
      "fontSize": 12,
      "guid": "{79285a8e-036c-446f-8a9c-78994e34bf78}",
      "historySize": 9001,
      "icon": "C:/icon-img-path",
      "name": "Name of profile",
      "padding": "0, 0, 0, 0",
      "snapOnInput": true,
      "startingDirectory": "%USERPROFILE%/Documents/workspace/",
      "useAcrylic": true
    }
  ],

  // Add custom color schemes to this array
  "schemes": [
    {
      "background": "#33FF00",
      "black": "#33FF00",
      "blue": "#3465A4",
      "brightBlack": "#5bac0b",
      "brightBlue": "#729FCF",
      "brightCyan": "#34E2E2",
      "brightGreen": "#8AE234",
      "brightPurple": "#AD7FA8",
      "brightRed": "#EF2929",
      "brightWhite": "#b1b1b1",
      "brightYellow": "#FCE94F",
      "cyan": "#06989A",
      "foreground": "#33FF00",
      "green": "#b6b6b6",
      "name": "Konsole",
      "purple": "#75507B",
      "red": "#CC0000",
      "white": "#219b02",
      "yellow": "#C4A000"
    }
  ],

  // Add any keybinding overrides to this array.
  // To unbind a default keybinding, set the command to "unbound"
  "keybindings": [
    { "command": "closePane", "keys": ["ctrl+w"] },
    { "command": "newTab", "keys": ["ctrl+t"] }
  ]
}

Modules

PS execution

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Power Shell example profile

Import-Module posh-git
Import-Module oh-my-posh
Import-Module PSReadLine
Set-Theme Paradox

Alliée de votre stratégie digitale, Useweb, votre agence web à Rennes