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

Keep instance running after browser closing #6836

Open
albertopasqualetto opened this issue Jun 12, 2024 · 3 comments
Open

Keep instance running after browser closing #6836

albertopasqualetto opened this issue Jun 12, 2024 · 3 comments
Labels
enhancement Some improvement that isn't a feature

Comments

@albertopasqualetto
Copy link

What is your suggestion?

Keep the VSCode instance up and don't close it even if browser is closed.

Why do you want this feature?

In order to setup Live Share and being able to connect to it always.

This would help in a lot of code-server use cases.

Are there any workarounds to get this functionality today?

No, AFAIK.

Are you interested in submitting a PR for this?

Don't know from where to start.

@albertopasqualetto albertopasqualetto added the enhancement Some improvement that isn't a feature label Jun 12, 2024
@albertopasqualetto albertopasqualetto changed the title Keep instance running after browser closing. Keep instance running after browser closing Jun 12, 2024
@code-asher
Copy link
Member

Thank you for the suggestion! I agree this would be ideal.

But, I do not think this is something we would want to do in code-server, my guess is it would be a pretty significant architectural change and since code-server just wraps VS Code, we would have to maintain the change with patch files which would be tough, so that change should probably be made directly to VS Code remote/web up at https://github.com/microsoft/vscode/.

@albertopasqualetto
Copy link
Author

@code-asher thanks, do you have any idea where to start from?

@code-asher
Copy link
Member

I do not have any concrete code to point out, but in general I think the problem is that the extension host is killed (and consequently all extensions are also killed) when the browser connection closes. If we can persist the extension host and its extensions, I believe this issue will be solved.

So first step is to prevent the extension host from being killed, which would be easy enough, mostly a matter of deleting that code, wherever it is.

Then, instead of spawning an extension host when getting a connection, we hook it up to the existing extension host, also seems easy enough.

From there though it gets fuzzy for me. Can we just reuse the initialization code of the extension host again, do the handshake, send whatever other data the extension host normally sends on a first connect? It seems likely to me we will need to send additional data to restore various states of the extension host and its extensions, and various components may have to be reworked to accept existing state rather than always initializing from zero.

Another open question in my mind is whether extensions themselves will have to be modified to support persistence. Maybe we will need new extension API for extensions to tell when a client closes or reconnects.

I speak as mostly an outsider though, the folks that wrote all this code up at https://github.com/microsoft/vscode might have much better ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

2 participants