I am building my own vscode extension and part of the task is to retrieve and edit the $PATH variable from my typescript code in the activation function. Here is what I tried
import * as vscode from 'vscode';
import { logger } from '../logger';
import { string } from 'yargs';
export const activate = async (context: vscode.ExtensionContext): Promise<void> => {
const path = context.environmentVariableCollection.get('$PATH');
logger.debug('Extension Pack activated');
};
The problem is that the function context.environmentVariableCollection.get('$PATH')
always returns an undefined variable for some reason.
Any hints?
P.s. I am specifically asking how can I do it using the vscode API and not how to do it using Node.js