
현재 작업 영역 폴더에서 통합 터미널(Powershell 사용)을 시작하도록 VSCode 설정을 구성했습니다.
"terminal.integrated.cwd": "${workspaceFolder}"
VSCode 외부에서 Powershell 창을 시작할 때 기본 시작 디렉터리를 내 사용자 프로필로 사용하고 싶습니다. 기본적으로 홈 디렉터리(C:\Users\stvhwrd)에서 시작하도록 Powershell 프로필을 구성했습니다.
Set-Location -Path "${env:USERPROFILE}"
VSCode에서 통합 터미널을 열면 프로필 설정이 VSCode 설정보다 우선하므로 통합 터미널은 항상 내 사용자 프로필 디렉터리에서 시작됩니다. cd
현재 프로젝트 디렉토리에 도달하려면 여러 레벨을 거쳐야 하기 때문에 이는 성가신 일입니다 .
통합 터미널이 현재 프로젝트 디렉터리에서 시작되고 외부 [독립] 터미널이 내 사용자 프로필에서 시작되도록 구성하려면 어떻게 해야 합니까?
답변1
Powershell 프로필을 편집합니다.
notepad $profile
조건부 검사를 추가하세요.VSCode로 설정된 터미널 환경 키시작에:
# Set default directory
if ("${env:VSCODE_CWD}" -or "${env:TERM_PROGRAM}" -eq "vscode")
{
# Allow VSCode settings to determine directory
}
else
{
Set-Location -Path "${env:USERPROFILE}"
}