1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

いい感じのWindows Terminal環境を作ってみる

Posted at

Windows Terminalは、2020年の春頃Microsoftから公開されたターミナルソフトです。
かつてのコマンドプロンプトやPowershellの標準ターミナルとは機能も見た目も大幅強化されました。
今回はそのWimdows Terminalを更に使いやすくしてみます。

oh-my-posh

oh-my-poshはざっくり言えばターミナルをいい感じにするソフトです。
今回はPowershell Coreにインストールします。

Powershellからサッとインストールできます。

winget install JanDeDobbeleer.OhMyPosh -s winget

インストールしただけではターミナルで使えないので、$PROFILEで初期化させます。
適当なエディタで開きます。notepadでもいいです。

notepad $PROFILE

「そんなファイルないぞ」って言われたら作ってあげてください

New-Item -Path $PROFILE -ItemType File -Force

プロファイルにoh-my-poshの初期化コマンドを書きます。

Microsoft.PowerShell_profile.ps1
oh-my-posh init pwsh | Invoke-Expression

プロファイルを再読み込みします

. $PROFILE

このままだと文字化けする(oh-my-poshは特殊なフォントを使っている)ので、フォントをインストールします。
この操作には管理者権限が必要です。

oh-my-posh font install

Windows Terminalのフォントを変更します。
ここではデフォルトのフォント(すべてのシェルで適用)を変更します。
profiles.defaults.font.faceを"MesloLGM NF"に変更すればOKです。

{
    "profiles":
    {
        "defaults":
        {
            "font":
            {
                "face": "MesloLGM NF"
            }
        }
    }
}

もう少し見やすくしてみる

これはやってもやらなくてもいいと思いますが、私は各ターミナルの背景画像にそれぞれのロゴを表示させています。
視覚的にどのターミナルを使ってるかわかりやすいのと、単純にかっこいいからです。
背景色も変えておくといいです。

cmd
(もはや使うことはないのですが‥)
image.png

Windows Powershell
image.png

Powershell Core
image.png

Ubuntu
image.png

まとめ

よいターミナルライフを!

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?