Skip to content

Draft: Shell server

chrysn requested to merge experimental-shell-server into main

This adds a shell server.

Current code is very very WIP, obviously unsafe, and has these large areas of open work:

  • Security: This is a demo case for EDHOC integration.
  • Terminal handling: We should probably get a PTY. (Seems that Ctrl-C to the cargo run wind up in the process). Maybe we get a login shell for free if we do it right.
  • Syncing is a mess (lots of Arc<Mutex<_>>), maybe scroll-ring is not the right tool for this job.
  • Right now this spawns a single global session. Simultaneously connected terminals will ... not conflict, but interact interestingly.
    • Might have a "start new shell" resource that creates a new stream pair.
    • Should figure out our buffer deletion pattern. Scroll-ring style means we just lose input, which is just one choice. If we decide to block and multiple terminals are connected, will any terminal confirming some data for deletion cause gaps in the other?
    • Can simultaneously connected terminals (which kind of is a feature) provide input in a well-ordered way? With the current crude just-POST-the-data it kinda works, but with a more elaborate ans "spec"-compliant version, there could be a cursor involved.
  • Everything else that I missed.
Edited by chrysn

Merge request reports