-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XDG_SESSION_ID and XDG_SESSION_TYPE environment in debugConfig.environment or console's environment are overrided by getConfigureEnvironment #3806
Comments
@upcliujie I tried the problem you described on my machine, but I was not able to reproduce the problem you described, can you give me some advice? |
@v-frankwang The terminal on win don't set XDG_SESSION_* to env so don't have this problem. Using a win PC to connect a linux PC by ssh-remote can reproduce this problem |
@v-frankwang This is a relevant code from the cmakeProject.ts file /**
* Both debugTarget and launchTarget called this funciton, so it's refactored out
* Array.concat's performance would not beat the Dict.merge a lot.
* This is also the point to fixing the issue #1987
*/
async getTargetLaunchEnvironment(drv: CMakeDriver | null, debugEnv?: DebuggerEnvironmentVariable[]): Promise<Environment> {
const env = util.fromDebuggerEnvironmentVars(debugEnv);
// Add environment variables from ConfigureEnvironment.
const configureEnv = await drv?.getConfigureEnvironment();
if ((drv?.useCMakePresets ?? false) && (checkConfigureOverridesPresent(this.workspaceContext.config) ?? false)) {
log.info(localize('launch.with.overrides', `NOTE: You are launching a target and there are some environment overrides being applied from your VS Code settings.`));
}
return EnvironmentUtils.merge([env, configureEnv]);
} XDF_SESSION_* is set in ConfigureEnvironment on linux so it will overwrite the environment we set in debugConfig.environment. |
@upcliujie Thank you very much for your reply, I have retried the problem as you have given advice, does this reproduce the problem you have described? |
@v-frankwang Yes,it's the problem I described. |
@gcampbell-msft I reproduced the issue based on the user's prompts and here are the steps I took to reproduce it: ENV:
|
@upcliujie @gcampbell-msft If I manually set the value of XDG_SESSION_TYPE to "wayland" in the terminal using the command: |
Brief Issue Summary
Problem 1:
The workspace vcode settings :
The code to get XDG_SESSION_ID and XDG_SESSION_TYPE environment with c++ :
We can't get the XDG_SESSION_ID and XDG_SESSION_TYPE in debugConfig.environment.
Problem 2:
Delete the worksapce vscode settings. Use tmux connect to another tty.
Run the code in Problem 1:
We can't get the same XDG_SESSION_ID and XDG_SESSION_TYPE environment value with tmux
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: