Skip to content

Commit f51d543

Browse files
committed
List Env Vars we care about only
Avoids leaking secrets in Env Vars and makes it safe to paste logs.
1 parent afcc93c commit f51d543

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/extension.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
142142
}
143143
logger.log('Environment variables:');
144144
Object.entries(process.env).forEach(([key, value]: [string, string | undefined]) => {
145-
logger.log(` ${key}: ${value}`);
145+
// only list environment variables that we actually care about.
146+
// this makes it safe for users to just paste the logs to whoever,
147+
// and avoids leaking secrets.
148+
if (["PATH"].includes(key)) {
149+
logger.log(` ${key}: ${value}`);
150+
}
146151
});
147152

148153
let serverExecutable: string;

0 commit comments

Comments
 (0)