sklass의 s-class 프로그래밍 blog

Visual Studio Code에서 code 명령어 영구적으로 설정하는 법(MacOS) 본문

shell

Visual Studio Code에서 code 명령어 영구적으로 설정하는 법(MacOS)

sklass 2021. 8. 21. 21:13

Visual Studio Code에서 code 명령어를 사용하기 위해서는 Visual Studio Code 앱을 열고, Command + Shift + p를 눌러준 다음, 아래와 같이 Shell Command: Install 'code' command in PATH를 설정해주어야 한다.

 

하지만 이와 같은 방법은 일시적인 방법으로 컴퓨터를 재시작하면 다시 설정을 해야하는 번거러움이 있다. 

이를 해결하기 위해서는 ~/.zshrc에 아래 명령어를 추가해주면 된다.

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}

 

'shell' 카테고리의 다른 글

rsync  (0) 2021.10.12
linux tee 명령어  (0) 2021.09.04
.bash_profile VS .zshrc  (0) 2021.08.21
Interactive Shell & Login Shell  (0) 2021.08.21
iTerm2 + zsh + oh my zsh  (0) 2021.08.18