본문 바로가기

ETC

VS CODE 기본 터미널 변경 방법 (powershell → git bash)

 

VSCODE 의 기본 터미널은 powershell이다.

git을 사용해 버전관리를 하는 중이라 git bash로 기본터미널을 변경했는데 갑자기 다음과 같은 에러 발생 

뿌앵. 당황하지 않고 구글링을 시작한다. 🙄

 

This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in `#terminal.integrated.profiles.windows#` and setting its profile name as the default in `#terminal.integrated.defaultProfile.windows#`. This will currently take priority over the new profiles settings but that will change in the future

 

 

 

VSCODE를 업데이트 한적이 없는데 업데이트 시 설정이 바뀌면서 일어난 일이라고 한다.

 

 

 

일단 ctrl + , 눌러 setting 파일로 접근 

 

terminal.integrated.defaultProfile.windows 검색 

 

이전 페이지 코드는 다음과 같다.

error가 나는 부분은 "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",

{
    "terminal.integrated.automationShell.windows": "",
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", <<<<<<<<<<<<<

    "git.autofetch": true,
    "terminal.integrated.fontSize": 15,
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter-notebook"
    },
    "explorer.compactFolders": false,
    "notebook.cellToolbarLocation": {
        "default": "right",
        "jupyter-notebook": "left"
    },
    "liveServer.settings.donotVerifyTags": true,
    "terminal.integrated.profiles.windows": {
   
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            "source": "Git Bash",
        }
    }
}

 

 

 

VS CODE 터미널 문서를 확인해 보니 terminal.intergrated.defaultProfile을 사용하라고 되어있었다.

먼저 terminal.intergrated.profiles.windows 작성 후, terminal.intergrated.defaultProfile를 Git Bash로 지정

(공식문서 https://code.visualstudio.com/docs/editor/integrated-terminal)

 

 

 

다음과 같이 Git Bash가 자동완성으로 뜸

 

 

 

수정 후 파일 소스 코드

{
    "terminal.integrated.defaultProfile.windows":"Git Bash",

    "git.autofetch": true,
    "terminal.integrated.fontSize": 15,
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter-notebook"
    },
    "explorer.compactFolders": false,
    "notebook.cellToolbarLocation": {
        "default": "right",
        "jupyter-notebook": "left"
    },
    "liveServer.settings.donotVerifyTags": true,
    "terminal.integrated.profiles.windows": {

        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            // "source": "Git Bash",
            "path":"C:\\Program Files\\Git\\bin\\bash.exe"
        }
    }
}

 

 

 

 

근데 아직도 처음에 키면 PowerShell이 떴다가 다시 한번 더 띄우면 git bash가 뜬다.

이 부분은 다시 확인해봐야할듯 😥

 

 

 

 

 

 

 

참고사이트🤞

https://gitjaesung.github.io/terminal-seting

https://code.visualstudio.com/docs/editor/integrated-terminal

https://murra.tistory.com/36

반응형