Visual Studio For Mac Open Folder

With Visual Studio “15” Preview, we’ve worked hard to simplify the basics and make it easier for you to launch into the fun stuff. The open folder feature will save you time and headaches in trying to assess whether a repo gets you 80% there or has already solved the problem for you.

Microsoft has releasedthe production version of Visual Studio 2019 IDE, in which updates occur when the machine is idle.

Where to download Visual Studio 2019

You can download Visual Studio 2019 from the Visual Studio website.

What’s new in the Visual Studio 2019

In the Visual Studio 2019, developers gain the following new and changed features:

  • It is easier to clone a Git repo or open an existing project. It is also easier to start a new project through improvements made to the template selection screen.
  • The Snapshot Debugger, for debugging applications in the Azure cloud, adds support for Azure Kubernetes Service and Virtual Machine Scale Set.
  • For debugging, data breakpoints for .Net Core apps help developers break only on value changes they are looking for.
  • For debugging, there is AI-assisted code completion for Visual Studio IntelliCode.
  • Developers can access hosted repos from Azure devops services through the Start window.
  • Developers can install extensions for other source-control hosts to view repos owned by the developer or the developer’s organization.
  • Updates are downloaded in the background, when the host machine is idle. When downloads are complete, users get a notification that the download is ready to be installed.
  • Performance improvements in stepping and branch switching.
  • Visual Studio Live Share, for collaboration, is installed by default. Live Share can be used for pair programming, conducting code reviews, presentations, or “mob programming” during hackathons.
  • Search has been improved for menus, commands, options, and installable components.
  • A document indicator is provided to understand code file “health,” which developers can run and configure through a one-click code cleanup.
  • Developers can save a collection of code cleanup fixers as a profile, to be run during cleanup.
  • .Net Core projects can be configured more easily with first-class project files.
  • Google Chrome can be launched with custom arguments, with developers able to debug JavaScript applications within the IDE.
  • Hot Path Highlighting identifies function calls that use the highest percentage of the CPU or that allocate the most objects.
  • C# and Visual Basic support a Regex parser. Regular expressions now are recognized and language features enabled on them. Regex strings are recognized when a string is passed to the Regex constructor or when a string is immediately preceded with a comment containing the string, Language=regex. Language features included now are classification, brace matching, highlight references, and diagnostics.
  • Developers can preview C# 8.0 language features, such as nullable reference types.
  • CPU profiling is offered for ASP.Net.
  • A single-project experience has been added for containerizing and debugging ASP.Net Web applications and console applications for .Net Core.
  • Visual Studio Kubernetes tools are integrated into the Azure development workload.
  • It is now easier to work with Python environments, with improved support for Open Folder workspaces using a new Python environment selector toolbar.
  • Visual Studio 2019 dumps Windows Mobile support for Universal Windows Platform (UWP). Developers who need to continue working on a UWP application for Windows 10 mobile devices should stick with Visual Studio 2017. (Microsoft formally abandoned its little-used Windows Mobile plaform in early 2019.)
  • The Search Deeper function has been changed to a dropdown for quickly selecting the depth of initial and subsequent searches.
  • Code style preferences can be applied from the command line with the dotnet format global tool.
  • An empty VSIX Project template has been added, for experimentation.
  • For C++, developers can open CMake caches generated by external tools, such as CMakeGUI or customized metabuild systems.
  • For C++, there is improved analysis via /Qspectre, providing mitigation assistance for the Spectre Variant 1 vulnerability.
  • For F#, performance has been improved.
  • Visual enhancements are offered for building ASP.Net web applications.
  • Visual Studio 2019 automatically downloads updates in the background while the developer’s computer is idle, thus enabling continued usage until it is time to install. Developers only need to wait during the actual installation.
  • The Per-Monitor Awareness preview feature is on by default for users meeting the system requirements of .Net Framework 4.8 and the Windows 10 April 2018 Update.
  • Tool windows such as Toolbox, Breakpoints, and Call Stack now should render sharply across monitors with different scale and display configurations.
  • The blue theme has been updated by dialing down luminosity and contrast.
  • The document health feature has been given a visual upgrade, with developers at a glance able to see errors or warnings in a document.
  • Code cleanup has its own control for quick access to features.
  • For C++ development, developers have access to a fresh version of the Microsoft Visual C++ compiler and libraries toolset (MSVC) that provides binary compatibility with the Visual Studio 2017 MSVC toolset and runtime.
  • For C++, integration with CMake build and test tools lets developers detect Vcpkg tool chains automatically for CMake projects. Developers also can use Just My Code debugging.
  • For Python, developers can switch between interpreters using the new Python Environments toolbar when editing Python files or working with projects or Open Folder workspaces. Developers also can create Visual Studio Live Share sessions to collaborate on Python code.
  • For C#, new C# 8.0 features include recursive pattern matching, for digging into the structure of an object, and switch expressions, a concise version of switch statements.
  • For .Net, refactoring and codefix capabilities have been added such as sync namespace and folder name.
  • For .Net, project files for .Net SDK-style projects are a first-class file type, supporting capabilities such as double-clicking a project node to open a file.
  • For web and container development, JavaScript debugging support for unit tests is enabled.
  • For web and container development, Visual Studio Kubernetes tools are integrated into the Azure development workload.
  • For mobile .Net developers using Xamarin, Visual Studio 2019 has improved build performance for developers using Xamarin.Android 9.1.1 or higher.
  • IntelliSense code editing capabilities are improved, via Visual Studio IntelliCode.

To continue reading this article register now

Learn More Existing Users Sign In

Active1 month ago

The docs mention an executable called code, but I'm not sure where I can find that so I can put it on my path. The zip I downloaded from the VSCode site did not include any such executable. (I am able to run the .app just fine.)

Is this a Windows-only thing?

jessehouwing
74.2k15 gold badges176 silver badges256 bronze badges
Nick HeinerNick Heiner
49.3k164 gold badges429 silver badges667 bronze badges
For

17 Answers

From the Visual Studio Code Setup page:

Tip: If you want to run VS Code from the terminal by simply typing 'code', VS Code has a command, Shell Command: Install 'code' command in PATH, to add 'code' to your $PATH variable list.

After installation, launch VS Code. Now open the Command Palette (F1 or ++P on Mac) and type shell command to find the Shell Command: Install 'code' command in PATH command.

After executing the command, restart the terminal for the new $PATH value to take effect. You'll be able to simply type 'code .' in any folder to start editing files in that folder.

Tracker1
14.7k9 gold badges68 silver badges98 bronze badges
ShaanShaan
6,1371 gold badge14 silver badges14 bronze badges

⚡️ The Easy Solution.

  1. Download, install and open Visual Studio Code.
  2. Open the Command Palette ( + + P on Mac) OR ViewCommand Palette

🌟 3. Type shell command to find Shell Command: Install 'code' command in PATH command

  1. Install it and you're done

📟 Here's a complimentary GIF.

After that, you can use code or code . in the terminal.

Cheers!

P.S. Theme name 🦄 Shades of Purple ↗

Ahmad AwaisAhmad Awais
14k3 gold badges49 silver badges43 bronze badges

We since updated the script to the following syntax to support multiple files and folders as arguments and to fix an issue with not detecting the current working directory properly:

Update for our VS Code 1.0 release:

Please use the command Install 'Code' command in path or Install 'code-insiders' command in path from the command palette (View | Command Palette) to make Code available to the command line.

Visual Studio

Josh Unger
3,1151 gold badge25 silver badges47 bronze badges
Benjamin PaseroBenjamin Pasero
53.4k10 gold badges66 silver badges49 bronze badges

If you want to open a file or folder on Visual Studio Code from your terminal, iTerm, etc below are the commands which come as default when you install Visual Studio Code

To open Visual Studio Code from command line

To open the entire folder/directory

To open a specific file

SudharshanSudharshan
1,8261 gold badge16 silver badges22 bronze badges

I have a ~/bin/code shell script that matches the command @BengaminPasero wrote.

I prefix ~/bin: to my $PATH which allows me to add a bunch of one off scripts without polluting my ~/.bash_profile script.

Tracker1Tracker1
14.7k9 gold badges68 silver badges98 bronze badges

After opening VSC and pressing (Command + Up + P) I tried typing in 'shell command' and nothing came up. In order to get 'Shell Command: Install 'code' command in PATH command' to come up, you must do the following:

  1. Press (Command, Up, P)

  2. Type > (this will show and run commands)

  3. Then type Shell Command: Install 'code' command in PATH command. It should then come up.

    Once you click it, it will update and you should be good to go!

DMuttzDMuttz

This was the tutorial I was looking for in this thread. It shows the way to open files in Visual Studio Code by writing code .

1.- Open the file

Bash

Terminal OS

2.- Add in your file the :

3.- Reinicialize terminal and try in the folder you want to open

4.- Then you can use it as shown in this comment: https://stackoverflow.com/a/41821250/10033560

Daniel DinerDaniel Diner

On OSX Mavericks I created a bash script named vscode (adapted from the .bashrc in VSCode Setup) in ~/bin:

vscode <file or directory> now works as expected.

peterdnpeterdn
1,6971 gold badge17 silver badges22 bronze badges

I discovered a neat workaround for mingw32 (i.e. for those of you using the version of bash which is installed by git-scm.com on windows):

IlanIlan
8591 gold badge9 silver badges14 bronze badges

Note: Only for Windows Users.

As many folks already suggested ways to open code from command prompt using code . command. This will only open Visual Studio Code Stable build. But If you have downloaded Visual Studio Code Insider build/version (Which has all latest build/features but unstable version) then you need to follow below instructions in windows :

  • Go to Control PanelSystem and SecuritySystem. Click on Advanced System Settings
  • Click on Environment Variables
  • Under System Variables tab, Click on Edit for Path Variable
  • Add a new path C:UserstsabuAppDataLocalProgramsMicrosoft VS Code Insidersbin(or)C:Program FilesMicrosoft VS Code Insidersbin based on location at which you have installed vscode insider in your machine.
    Open a new command prompt and type code-insiders . to open vscode-insider build/version
Sabunkar Tejas SahaileshSabunkar Tejas Sahailesh

I had this issue because of VS Code Insiders.The path variable was there but I needed to rename the code-insiders.cmd inside to code.cmd .

Maybe this is useful to someone.

pungggipungggi

You can use the vscode: protocol that Visual Studio Code defines:

You can also use

if you do not fancy modifying your path

xvergesxverges
3,4071 gold badge31 silver badges52 bronze badges

its very simple:

Launching from the Command Line

You can also run VS Code from the terminal by typing 'code' after adding it to the path:

Launch VS Code.Open the Command Palette (⇧⌘P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.

source

JoolahJoolah
5,3838 gold badges60 silver badges87 bronze badges

Added this to /usr/local/bin/code, you might have to modify the path if they are different.

Make executable afterwards

user1116928user1116928

I ran: open -a 'Visual Studio Code' [folder-name] to open a folder with my Visual Studio Code application. Folder name is optional if you just want to open the application. Not sure if this is exactly your use-case, but hope this helps!

mmilutinovic1313mmilutinovic1313

The instruction given at VS Code Command Line for launching a path are incorrect; the leading colon shown in the example doesn't work. However, launching with a backslash terminated directory name opens the specified directory as expected.

So, for example,

Visual Studio For Mac Os

code C:UsersDAVEDocumentsProgrammingAngularStringCalculatorsrc

Install Visual Studio On Mac

opens the Visual Studio Code editor in directory C:UsersDAVEDocumentsProgrammingAngularStringCalculatorsrc.

Important: The terminal backslash, though optional, is useful, as it makes clear that the intend is to open a directory, as opposed to a file. Bear in mind that file name extensions are, and always have been, optional.

Beware: The directory that gets appended to the PATH list is the bin directory, and the shell command code launches a Windows NT Command script.

Hence, when incorporated into another shell script, code must be called or started if you expect the remainder of the script to run. Thankfully, I discovered this before my first test of a new shell script that I am creating to start an Angular 2 project in a local Web server, my default Web browser, and Visual Studio Code, all at once.

Visual Studio For Mac

Following is my Angular startup script, adapted to eliminate a dependency on one of my system utilities that is published elsewhere, but not strictly required.

goto SKIPREM

:SKIPREM

David A. GrayDavid A. Gray

For windows Usersjust type in

More commands herehttps://code.visualstudio.com/docs/editor/command-line

Bhargav Rao
32.6k21 gold badges95 silver badges115 bronze badges

Visual Studio For Mac Licensing

Luke AngelLuke Angel

Not the answer you're looking for? Browse other questions tagged visual-studio-code or ask your own question.

Comments are closed.