新しい Windows ターミナルに Git-Bash を追加する 質問する

新しい Windows ターミナルに Git-Bash を追加する 質問する

新しい Windows ターミナルに新しいターミナル (Git Bash) を追加しようとしていますが、うまく動作しません。

commandline配列内のプロパティprofilesを に変更しようとしましたgit-bash.exeが、うまくいきませんでした。

これを機能させる方法を誰か知っていますか?

ベストアンサー1

概要

  1. Ctrl+で設定を開く,
  2. 以下のプロファイル オプションのいずれか (インストールされている git のバージョンによって異なります) をファイル"list":のこの部分に追加する必要がありますsettings.json

Windowsターミナルサイドバーでsettings.jsonを開く

{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{00000000-0000-0000-ba54-000000000001}",

    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles
        },
        "list":
        [
            <put one of the configuration below right here>
        ]
    }
}

プロフィールオプション

commandlineおよびを使用している場合は、正しいパスのコメントを解除しますicon

  • Windows用のGit%PROGRAMFILES%
  • Windows用のGit%USERPROFILE%
  • 使用している場合スクープ
{
    "guid": "{00000000-0000-0000-ba54-000000000002}",
    "commandline": "%PROGRAMFILES%/Git/bin/bash.exe -i -l",
    // "commandline": "%USERPROFILE%/AppData/Local/Programs/Git/bin/bash.exe -l -i",
    // "commandline": "%USERPROFILE%/scoop/apps/git/current/usr/bin/bash.exe -l -i",
    "icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
    // "icon": "%USERPROFILE%/AppData/Local/Programs/Git/mingw64/share/git/git-for-windows.ico",
    // "icon": "%USERPROFILE%/scoop/apps/git/current/usr/share/git/git-for-windows.ico",
    "name" : "Bash",
    "startingDirectory" : "%USERPROFILE%"
},

次のような他のオプションを追加することもできます:

{
    "guid": "{00000000-0000-0000-ba54-000000000002}",
    // ...
    "acrylicOpacity" : 0.75,
    "closeOnExit" : true,
    "colorScheme" : "Campbell",
    "cursorColor" : "#FFFFFF",
    "cursorShape" : "bar",
    "fontFace" : "Consolas",
    "fontSize" : 10,
    "historySize" : 9001,
    "padding" : "0, 0, 0, 0",
    "snapOnInput" : true,
    "useAcrylic" : true
}

ノート

  • あなた自身のguidものを作るhttps://github.com/microsoft/terminal/pull/2475これはもう生成されません。
  • は>guidで使用できるので、Windowsターミナルを起動するか押すと、デフォルトでbashが起動します。globalsdefaultProfileCtrlShiftT
"defaultProfile" : "{00000000-0000-0000-ba54-000000000001}",
  • -l -i.bash_profile確実にロードされるように
  • 環境変数を使用して、さまざまなシステムに正しくマップできるようにします。
  • git/bin/bash.exe追加のプロセスを生成するという犠牲を払って環境が正しく渡されることを保証するためのターゲット。git/usr/bin/bash.exe同じように動作しますが、gitパスには入りません。

私はScoopを使っている設定を持っています出典: trajano

おすすめ記事