Hacker News new | ask | show | jobs
by skimdesk 956 days ago
Really fun!

I have been experimenting with similar idea myself. I was curious on how you handle instantiating the terminal state for new clients. Seems like you're storing a buffer [0] of past output, and replaying that?

[0] https://github.com/ekzhang/sshx/blob/91c82d46cde4d1ffa0ae34e...

1 comments

Yep, it’s a rolling 2 MiB buffer in RAM. Also do some snapshotting for persistence / server fault-tolerance, and that size is much smaller.
Does that mean it can avoid having to interpret terminal control codes (ie be a full terminal emulator)? That's a clever way.