vscode-remote-oss icon indicating copy to clipboard operation
vscode-remote-oss copied to clipboard

[WIP] Script remote type

Open CGamesPlay opened this issue 2 years ago • 0 comments

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 listenScript which is a short- or long-running process that is expected to listen on the configured host/port.
  • [x] Add listenScriptReady which is a regex. When the listenScript outputs the regex, it is expected to be ready to accept connections. Note: the listenScript can also cleanly exit, but then Remote OSS cannot shut down the process when disconnecting.
  • [ ] Support connectScript which 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 connectionToken behavior: true will 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)

CGamesPlay avatar Aug 28 '23 01:08 CGamesPlay