Launch VSCode from source through WSL

  • 9 months ago
Comment

ChatGPT
1 / 1

To launch Visual Studio Code (VSCode) from the Windows Subsystem for Linux (WSL) using its source code, you need to set up the necessary environment variables and execute the code command. Here's how you can do it:

  1. Install VSCode in WSL:
    First, make sure you have Visual Studio Code installed in your WSL environment. You can download and install VSCode in WSL using the following command:

    bash
    sudo apt update
    sudo apt install code
  2. Install Node.js:
    VSCode is built with Node.js, so you need to have Node.js installed in your WSL environment. You can install Node.js using the following commands:

    bash
    curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
    sudo apt-get install -y nodejs
  3. Start VSCode:
    To launch VSCode from WSL using its source code, you can use the following command:

    bash
    code ~/path/to/vscode/source

    Replace ~/path/to/vscode/source with the actual path to the directory containing the VSCode source code.

Note that launching VSCode from the WSL command line using its source code may not provide the same experience as running the prebuilt executable from Windows. The prebuilt VSCode executable includes platform-specific optimizations, dependencies, and integrations that might not be present when running it from the source code.

If you encounter issues or limitations when running VSCode from the WSL command line using its source code, consider using the prebuilt executable for a more stable experience.

Additionally, if you're interested in using the WSL extension for VSCode, you can install it from the VSCode marketplace. This extension provides enhanced integration between VSCode and your WSL environment.