Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collaborative terminals #1040

Open
davidbrochart opened this issue Oct 28, 2022 · 3 comments
Open

Collaborative terminals #1040

davidbrochart opened this issue Oct 28, 2022 · 3 comments

Comments

@davidbrochart
Copy link
Contributor

davidbrochart commented Oct 28, 2022

Problem

Currently, terminals are rendered in JupterLab with xterm.js, and the backend serves the "terminal protocol" over WebSocket. This allows collaboration, as the back-end broadcasts terminal events to all front-ends, and so everyone sees what others are doing in real-time.
But it doesn't handle conflicts. For instance, imagine a text editing terminal application, like vim. Ultimately, this is equivalent to a shared document, and it will not play well if several users modify it concurrently.

Proposed Solution

I think we could have a "Y shared terminal" document. Actually, it could almost consist of just a YText (plus handling of styling, colors, etc.), as far as the Y structure is concerned. But of course the back-end would need to "speak the terminal protocol", and translate that to cursor movement/character insertion/deletion in the YText. We could use pyte for that.
Then we could get rid of the terminals WebSocket (as it would go through the Y WebSocket), and xterm.js in JupyterLab. We would still need a renderer though, for colors and such, but in principle a simple text editor would be enough.

Additional context

This is going in the same direction as #900, basically taking advantage of RTC and reducing the complexity of front-ends: they don't need to speak the kernel protocol or the "terminal protocol".

@ellisonbg
Copy link
Contributor

ellisonbg commented Oct 29, 2022 via email

@kzgrzendek
Copy link

@ellisonbg

I'm also uping this issues ; we're providing a jhub collaboration environments to our users, and I know they would be much less confused about terminals in collaborations thanks to that proposition :)

@davidbrochart
Copy link
Contributor Author

As mentioned here, I'm working in that direction in jupyter-server/jupyverse#364.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants