Visual Studio Code 기본 터미널 Git Bash로 변경하기

박정재·2022년 3월 16일
0
post-thumbnail

부캠에서 어제 이고잉님의 Github 특강을 들으며 중간에 실습을 위해 Windows 사용자는 VS Code의 기본 터미널을 Git Bash로 변경하는 시간을 가졌다. Git Bash가 안 보이는 사람은 Command Prompt로 설정하라고 하셨다. 대부분의 캠퍼 분들은 Git Bash로 설정하셨는데, 나는 Git Bash가 안 보여서 일단 Command Prompt로 설정해두었다. 그러다 오늘 VS Code로 예전 강의를 복습하다가, 문득 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 Code를 재부팅하면 된다고 한다.

설정 끝!

Reference

profile
Keep on dreaming and dreaming

0개의 댓글