LoginSignup
1
3

More than 3 years have passed since last update.

Windows Terminal入門

Posted at

概要

インストールから、PowershellをOh-my-zshっぽい見た目にするまで。

インストール

Microsoft Storeから Windows Terminalを検索、インストール

テーマの設定

メニューバーの下向き矢印 > Setting
settings.jsonファイルが開く

   "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
        "colorScheme":"Tango Dark"
        },

"colorScheme":"カラースキーム名"
と設定する。
シェルに関係なくデフォルトとしたい場合は上記の場所に記述する。
設定可能なカラースキームは下記。
https://aka.ms/terminal-color-schemes

Oh-my-zsh風の表示

posh-git, Oh-my-posh, PSReadline というモジュールがあるのでそれを使う。

powershellから以下のコマンドを実施

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

PSReadLineをインストールする際 -AllowPrerelease を入れるとエラーが出るので、オプションを消す

notepad $PROFILEして、開いたファイルに下記を記入して保存。

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

Powershellを再起動。
scriptがLoadできないとエラーが出る場合は、Powershell上で
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Run as Administratorが必要な場合あり

フォント設定

https://qiita.com/rubytomato@github/items/e88cab84f36e44797cf2
を参照。

zipを解凍して CascadiaCodePL.otf ファイルをインストール。

再びWindows terminalのSetting

    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
        "colorScheme":"Tango Dark",
        "fontFace":"Cascadia Code PL"

fontFaceにCascadia Code PLを追加。行区切りのカンマを忘れずに

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3