vscode-remote-oss
vscode-remote-oss copied to clipboard
[WIP] Script remote type
This is a work in progress and not ready to be merged. I recommend reviewing this PR by each commit rather than the overall "files changed" view. Closes #8.
This PR adds a new type of remote called script, which allows the user to specify a custom shell script to use to start an REH before connecting to it.
Remaining items:
- [x] Add a
listenScriptwhich is a short- or long-running process that is expected to listen on the configured host/port. - [x] Add
listenScriptReadywhich is a regex. When thelistenScriptoutputs the regex, it is expected to be ready to accept connections. Note: thelistenScriptcan also cleanly exit, but then Remote OSS cannot shut down the process when disconnecting. - [ ] Support
connectScriptwhich is a script that is expected to directly talk to an REH over stdio (required for environments like devcontainers where port forwards cannot be added ad-hoc). - [ ] Modify
connectionTokenbehavior:truewill cause Remote OSS to autogenerate a connection token instead of prompting, which will be provided to the scripts via an environment variable. - [ ] Expose some useful environment variables to the scripts:
REMOTE_HOST,REMOTE_PORT,REH_VERSION,CONNECTION_TOKEN. - [ ] Verify that reconnections work in a sane way.
- [ ] Make the connection process cancelable.
- [ ] Document everything and provide an example devcontainer configuration.
- [ ] Add support for custom scripts accessible via command palette (e.g. "restart devcontainer").
- [ ] Investigate running the scripts as a process group so that it isn't just the parent process which gets killed when disconnecting.
- [ ] Remove the "manual" item from the top of the GUI and just put all configured hosts in the root (or allow the user to create a custom hierarchy)