-
Notifications
You must be signed in to change notification settings - Fork 9
How to set $DISPLAY for debug configurations started with "console": "internalConsole"
#41
Comments
I assume this is a bug in either vscode or vscode-python, but as it's pretty specific to DISPLAY in my case (the two envs are identical up to some 10 environment variables all related to terminal- and X11-related things), checking Remote X11 is where I started. So I was looking to see if I can find out in which way DISPLAY is set. I did not find it in the code, however. Would you mind pointing me at that part where you set it? Oh, I just now found it - no idea how I could miss the RemoteHandler before: vscode-remote-x11/extension/src/RemoteHandler.ts Lines 94 to 97 in 3295b2b
|
Yeah. I'm using an extension API to add environment variables there. I think it only adds them to the integrated terminal though, not to VS Code's own environment. If you're comfortable with building the extension yourself, what happens if you also add this to that function? process.env['DISPLAY'] = display; That should add it to VS Code's environment too, which will hopefully make |
That seems to be the case, even if they don't say it explicitly:
https://code.visualstudio.com/api/references/vscode-api#ExtensionContext
This seems like a good workaround. I did not build myself, but I used https://github.com/GoNZooo/vscode-environment-injector to inject DISPLAY using that method*, and I might still file this issue with vscode - considering |
I am using Python, and the following launch configs demonstrate my problem:
The code:
With P1, I get
With P2, however, I get
I could add an
"env"
entry to the debug configuration having"console": "internalConsole"
, but how to get the correct value?Adding
to P2 does not work as it's empty.
The text was updated successfully, but these errors were encountered: