VSCode 터미널에서 - Powershell 프롬프트 경로 짧게 하기
2018.06.29 03:17
function prompt { $p = Split-Path -leaf -path (Get-Location) "$p> " }
출처: https://superuser.com/questions/446827/configure-the-windows-powershell-to-display-only-the-current-folder-name-in-the?answertab=active#tab-top
위에꺼는 경로가 그냥 다 날라가버리네...;; 밑에걸로 하니까 된다.
이걸 vscode에서 자동으로 뜨게 할려는데 방법을 모르겠다. ㅆ...
function prompt { $host.ui.rawui.WindowTitle = "PS $pwd"; $p = 'PS ' + ($pwd -split '\\')[0]+' '+$(($pwd -split '\\')[-1] -join '\') + '> '; return $p }
출처: https://social.technet.microsoft.com/Forums/lync/en-US/4fb9f6ab-f23b-4a9c-9355-8a778c4a8de4/how-to-make-the-path-shorter-in-the-prompt?forum=winserverpowershell
vscode 환경설정에서 아래 내용을 추가한다.
"terminal.integrated.shellArgs.windows": ["-ExecutionPolicy","Bypass","-NoLogo","-NoProfile","-NoExit", "-Command", "function prompt { $host.ui.rawui.WindowTitle = \"PS $pwd\"; $p = $(($pwd -split '\\\\')[-1] -join '\\') + '$ '; return $p }"]
NoExit 옵션 출처: https://github.com/Microsoft/vscode/issues/34019
끝.
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
» | VSCode 터미널에서 - Powershell 프롬프트 경로 짧게 하기 | 꿈돌이 | 2018.06.29 | 632 |