File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import path from "node:path" ;
12import * as vscode from "vscode" ;
23import {
34 MISE_COPY_ENV_VARIABLE_NAME ,
@@ -334,12 +335,22 @@ function updateEnvironment(
334335 context . environmentVariableCollection . description =
335336 "Provide environment variables from `mise env`" ;
336337 for ( const [ name , value ] of envs . entries ( ) ) {
337- process . env [ name ] = value ;
338- context . environmentVariableCollection . replace ( name , value ) ;
338+ if ( name . toUpperCase ( ) === "PATH" ) {
339+ const uniquePaths = Array . from ( new Set ( value . split ( path . delimiter ) ) ) . join (
340+ path . delimiter ,
341+ ) ;
342+ process . env [ name ] = uniquePaths ;
343+ context . environmentVariableCollection . replace ( name , uniquePaths ) ;
344+ } else {
345+ process . env [ name ] = value ;
346+ context . environmentVariableCollection . replace ( name , value ) ;
347+ }
339348 }
340349
341350 for ( const [ name ] of removedEnvs ) {
342- process . env [ name ] = undefined ;
351+ if ( name . toUpperCase ( ) !== "PATH" ) {
352+ process . env [ name ] = undefined ;
353+ }
343354 context . environmentVariableCollection . delete ( name ) ;
344355 }
345356}
You can’t perform that action at this time.
0 commit comments