Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
When developing using this extension, inside of any environment, it isn't possible to any CLI in the integrated terminal to open a link in the external browser. For example, gh needs a browser to do the login section. See:
However, since the vscode-server has access to the VS Code running on the host machine, I think it would be possible to write a wrapper for the xdg-open, similar to wslview in order to make this seamless.
One idea would be to put it in code itself, something like: code browse. It could be also useful for people using Codespaces or remote containers when they want to automate some steps such as in devcontainer.json's postCreateCommand put something like code browse localhost:3000/api/docs.
VS Code could then contribute to the integrated terminal with an environment variable BROWSER=" code browse", or even creating a shim and symlinking as xdg-open in order to make the CLIs to use this wrapper by default when inside the integrated terminal.
Notice I just said one example, but I think we can have many more over there.
When developing using this extension, inside of any environment, it isn't possible to any CLI in the integrated terminal to open a link in the external browser. For example,
gh
needs a browser to do the login section. See:It is totally normal since
xdg-open
isn't available in the container. If we are inside WSL we can at least usewslview
with this trick https://github.com/cli/cli/issues/826#issuecomment-646528240.However, since the
vscode-server
has access to the VS Code running on the host machine, I think it would be possible to write a wrapper for thexdg-open
, similar towslview
in order to make this seamless.One idea would be to put it in
code
itself, something like:code browse
. It could be also useful for people using Codespaces or remote containers when they want to automate some steps such as indevcontainer.json
'spostCreateCommand
put something likecode browse localhost:3000/api/docs
.VS Code could then contribute to the integrated terminal with an environment variable
BROWSER=" code browse"
, or even creating a shim and symlinking asxdg-open
in order to make the CLIs to use this wrapper by default when inside the integrated terminal.Notice I just said one example, but I think we can have many more over there.