2021년 VSCode에서 Git Bash를 통합 터미널로 설정하는 방법

11038 단어 vscodebashwebdev
  "terminal.integrated.profiles.windows": {
    "PowerShell": { "source": "PowerShell", "icon": "terminal-powershell" },
    "Command Prompt": {
      "path": [
        "${env:windir}\\Sysnative\\cmd.exe",
        "${env:windir}\\System32\\cmd.exe"
      ],
      "icon": "terminal-cmd"
    },
    "GitBash": {
      "path": ["C:\\Program Files\\Git\\bin\\bash.exe"],
      "source": "Git Bash",
      "icon": "terminal-bash"
    },
    "terminal.integrated.defaultProfile.windows": "GitBash",



2021년 4월부터 "terminal.integrated.shell.windows"는 VSCode에서 더 이상 사용되지 않습니다.

"terminal.integrated.shell.windows": "C:\\...\\...\\bin\\bash.exe",


Windows 10의 VSCode 버전 1.56에서 Git Bash를 기본 통합 터미널로 구성하려면



1단계: 명령 팔레트 열기(CMD + Shift + P)
2단계: "기본 설정: 사용자 설정 열기(JSON)"검색
3단계: ""(큰따옴표 키)를 입력하여 새 필드를 만듭니다. 인용 유형 "터미널"내부. 옵션 목록이 나타납니다.
4단계: terminal.integrated.profiles.windows를 선택합니다. terminal.integrated.profiles.windows를 선택하면 다음으로 확장됩니다.

"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"
  },
  "GitBash": {
    "source": "Git Bash",
    "path": ["C:\\Program Files\\Git\\bin\\bash.exe"],
    "icon": "terminal-bash"
  }
},


5단계: 기본 터미널을 Git Bash로 설정

  "terminal.integrated.defaultProfile.windows": "GitBash",


중요한
defaultProfile.windows 값이 작동하려면 한 단어여야 합니다.

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


작동하지 않습니다!

//끝

선적 서류 비치:



  • VSCode version 1.56 Release Notes
    https://code.visualstudio.com/docs/editor/integrated-terminal#_windows
  • Troubleshoot Terminal launch failures

  • 관련된



  • Shell Launcher: Easily launch multiple shell configurations in the terminal
  • 좋은 웹페이지 즐겨찾기