How to permanently open the Visual Studio Code with code . command in terminal

Krishna Bagale
1 min readSep 26, 2020

--

  • At first, open your terminal and go to your root user directory. Something like /Users/krishnabagale
  • Type open -t .bash_profile
  • Then add the following path to .bash_profile

code () { VSCODE_CWD=”$PWD” open -n -b “com.microsoft.VSCode” — args $*

  • Save the bash profile and quit the terminal. Now you can open any file/folder to VsCode with code .

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Krishna Bagale
Krishna Bagale

Written by Krishna Bagale

I am a software developer, living in Finland. I am open for new innovative ideas and willing to formulate into reality. Keep contact!

No responses yet

Write a response