Open davidbrochart opened 1 month ago
we could use a CodeMirror text editor
As long as we configure it to be 1-line editor this would not be a problem. input()
does not accept multi-line. There is also a question of latency and performance. Though yes, it might be worth exploring.
But input()
is Python, while the kernel protocol for stdin
is more general, and it can actually be an improvement to have multi-line support, what do you think?
There is also a question of latency and performance.
Mmm but CRDTs are local-first, so there shouldn't be any latency for what the local user types, only for remote users, which mostly depends on the network.
A frontend observing cell output changes would see the addition of an output of type
stdin
, and consequently show an input box. In JupyterLab, we could use a CodeMirror text editor, which would have the advantage of having the awareness for free (and show user cursors). Thestdin
output has anid
, which we use to create a WebSocket connector to the room in the backend with thisid
. Along with the text editor, there should be a "submit" button. Once submitted, the text editor is removed and the plain text shown instead.