Visual Studioコードのデフォルト端末Git Bashに変更


昨日、ブカンプで李戈穎のGithub講座を聞きました.中間実習のため、WindowsユーザーはVSCodeの基本端末をGitBashに変更しました.GitBashが見えないと言う人はCommandPromptほとんどのカメラはGit Bashに設定されていて、Git Bashが見えないので、まずCommandPromptに設定します.そして今日はVSコードで以前のレッスンを復習していたのですが、突然cmdに設定するのがちょっと目障りだと思い、Git Bashに設定する方法を探しました.
検索すると、いくつかの文章がVS code内のsetting.json"terminal.integrated.shell.windows"を編集して修正できることを示しているので、設定したいのですが、VS codeではこの機能が廃止され、"terminal.integrated.profiles.windows""terminal.integrated.defaultProfile.windows"の使用を提示しています.さらに調べてみると、setting.jsonファイルに以下のコードを追加すればよい.
"terminal.integrated.profiles.windows": {
        "GitBash": {
            "path":["D:\\Git\\bin\\bash.exe"], // git 설치한 경로로 설정
            "icon":"terminal-bash"
        },
  
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
  
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
    },

    "terminal.integrated.defaultProfile.windows": "GitBash",
また、설정(ctrl + ,)からterminalを検索した後、Terminal:Explorer kindexternalに変更し、VSコードを再起動すればよい.
設定完了!

Reference

  • https://zaraza.tistory.com/32