Currently when an extension is disposed, vscode (as far as I can tell) will ignore usage of EnvironmentVariableCollection.clear() or EnvironmentVariableCollection.delete(key)
context.subscriptions.push({
dispose() {
// Tried both clear and replace at the same time, as well as independently. Seemingly no results with any combination
context.environmentVariableCollection.replace("MY_UNIX_SOCKET", "");
context.environmentVariableCollection.clear();
},
});
This is frustrating in our use case, because we have a unix socket that is created each time the extension starts - which means that if the user restarts the extension host we generate a new socket url. Existing terminals then can no longer communicate with the socket, and have to relaunch their terminal. Currently as a workaround I'm storing the socket url in context.globalState and reusing it on restart. This works and existing terminals can just keep assuming the stale URL is correct, but ideally we'd be able to create a new one.
Currently when an extension is disposed, vscode (as far as I can tell) will ignore usage of
EnvironmentVariableCollection.clear()
orEnvironmentVariableCollection.delete(key)
This is frustrating in our use case, because we have a unix socket that is created each time the extension starts - which means that if the user restarts the extension host we generate a new socket url. Existing terminals then can no longer communicate with the socket, and have to relaunch their terminal. Currently as a workaround I'm storing the socket url in
context.globalState
and reusing it on restart. This works and existing terminals can just keep assuming the stale URL is correct, but ideally we'd be able to create a new one.