joelspadin / vscode-remote-x11

Visual Studio Code extension that sets the DISPLAY environment variable in remote workspaces
39 stars 9 forks source link

Nice extension! But how it works? Where does it get the right display number from? #58

Open Harold0 opened 3 years ago

Harold0 commented 3 years ago

I'm new to Linux, and this extension helps a lot! This extension works like magic, but I'm confused by how it works.

for e.g. the extension provide DISPLAY=localhost:x.0, but where does this display number x come from?

From code, It seems that the extension build a magical SSH session which can automatically assign the $DISPLAY variable ??

When I'm not using this extension, why a vscode SSH session is not 'born' with this same env variable, and reveal nothing when I try "echo $DISPLAY" ?

And furthermore, how can I establish such a magical SSH session, without the help of this extension?