Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I can't read much of Go so can anyone explain how does this work at a high-level? The Vim editing example looks really cool! Does it keep taking a snapshot of the running command and send the data via a websocket?


https://github.com/yudai/gotty/blob/master/app/app.go#L73-L1...

^ Those are the key lines really.

It's running the command in a pseudo-terminal, capturing the output (as text) and sending it over a web socket.


I doubt it takes snapshots, I suspect it just runs the program with a redirected and buffered stdin, stdout, and stderr.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: