.. _codeserver_tool_card: Code Server ^^^^^^^^^^^ Code Server provides a browser-based **Visual Studio Code** environment running directly on the HPC cluster. It allows users to edit files, manage projects, and work with terminal sessions from a web browser. .. image:: ../img/foldspace_codeserver_screen_example.png :alt: Example of Foldspace code-server interface :width: 700px :align: center | Start the tool -------------- Launch a new Code Server instance with the command: .. code-block:: bash foldspace --user --cluster --tool codeserver After the command is executed, a Slurm job is submitted and Code Server starts on the allocated compute node. Foldspace will then display a URL and a password to access the service. Open the URL in your browser and enter the provided password when prompted. Using Code Server ----------------- After connecting to the application, you can use Code Server as you would use a local Visual Studio Code installation. Files are accessed directly from the cluster file system, and the integrated terminal provides access to the environment running on the allocated compute node. The following sections describe some commonly encountered features and configuration steps. Restricted Mode ~~~~~~~~~~~~~~~ When Code Server is opened for the first time, the current workspace may be loaded in `Restricted Mode`. In this mode, some features and extensions may be disabled for security reasons. A notification banner appears on the window indicating that the workspace is in `Restricted Mode`. To trust the workspace and enable all Code Server features: - Click `Manage` in the `Restricted Mode` banner. - Select `Trust Workspace`. Confirm the action when prompted. Once the workspace is trusted, all editor features and installed extensions become available. Extensions ~~~~~~~~~~ Code Server supports most `Visual Studio Code` extensions available from the `Open VSX Registry`. Install an extension by following these steps: - Click the `Extensions` icon in the `Activity Bar` on the left. - Search for the desired extension. - Click `Install`. Some extensions require the workspace to be trusted. If an extension appears disabled: - Ensure the workspace is not in Restricted Mode. - Reload the window if requested by Code Server. Extensions can be managed from the `Extensions` panel, where they can be enabled, disabled, updated, or uninstalled. .. note:: Installed extensions are stored in the user's Code Server configuration directory (`.config/code-server/extensions`) and are automatically available in subsequent Code Server sessions. Extensions only need to be installed once. Integrated Terminal ~~~~~~~~~~~~~~~~~~~ You can open an integrated terminal in Code Server by selecting `Terminal > New Terminal` from the menu. The terminal runs on the same compute node allocated to the Code Server session and provides access to the cluster environment.