Skip to main content

Setting your default editor for GitHub Codespaces

You can set your default editor for Codespaces in your personal settings page.

On the settings page, you can set your editor preference so that when you create a codespace, or open an existing codespace, it is opened in your choice of:

  • Visual Studio Code (desktop application)
  • Visual Studio Code (web client application)
  • JetBrains Gateway - for opening codespaces in a JetBrains IDE
  • JupyterLab - the web interface for Project Jupyter

When you create a new codespace from a template, it is always opened in the Visual Studio Code web client. You can reopen an existing codespace in any supported editor. For more information, see "Opening an existing codespace."

If you want to use Visual Studio Code as your default editor for GitHub Codespaces, you need to install Visual Studio Code and the GitHub Codespaces extension for Visual Studio Code. For more information, see the download page for Visual Studio Code and the GitHub Codespaces extension on the Visual Studio Code marketplace.

If you want to work on a codespace in a JetBrains IDE you must install the JetBrains Gateway. For more information, see "Using GitHub Codespaces in your JetBrains IDE."

Setting your default editor

  1. In the upper-right corner of any page on GitHub, click your profile photo, then click Settings.

  2. In the "Code, planning, and automation" section of the sidebar, click Codespaces.

  3. Under "Editor preference", select the option you want.

    Screenshot of the "Editor preference" options, with "Visual Studio Code for Web" selected.

    • If you choose Visual Studio Code or JetBrains Gateway, you must make sure you have installed the selected application on your local machine.

    • If you choose Visual Studio Code, GitHub Codespaces will automatically open in the desktop application when you next create or open a codespace.

      You may need to allow access to both your browser and Visual Studio Code for it to open successfully.

    • If you choose JetBrains Gateway, the Gateway application will automatically open when you next create or open a codespace.

      The first time you open a codespace this way you must give permission to open the application.

      The Gateway application will open and the codespace will then be automatically selected. You can then choose a JetBrains IDE, if you have not previously done so, and click Connect to open the codespace in the JetBrains client. For more information, see "Using GitHub Codespaces in your JetBrains IDE."

      To connect to a codespace from the Gateway application, you must have an SSH server running on the codespace. The codespace you connect to must be running an SSH server. The default dev container image includes an SSH server, which is started automatically. If your codespaces are not created from the default image, you can install and start an SSH server by adding the following to the features object in your devcontainer.json file.

      "features": {
          // ...
          "ghcr.io/devcontainers/features/sshd:1": {
              "version": "latest"
          },
          // ...
      }
      
    • If you choose JupyterLab, the JupyterLab application must be installed in the codespaces you open. The default dev container image includes JupyterLab, so codespaces created from the default image will always have JupyterLab installed. For more information about the default image, see "Introduction to dev containers" and the devcontainers/images repository. If you're not using the default image in your dev container configuration, you can install JupyterLab by adding the ghcr.io/devcontainers/features/python feature to your devcontainer.json file. You should include the option "installJupyterlab": true. For more information, see the README for the python feature, in the devcontainers/features repository.

Further reading