Skip to content

Fixes restarting desktop environment when trying to reconnect #100

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

Merged
merged 2 commits into from
May 29, 2025

Conversation

mishushakov
Copy link
Member

@mishushakov mishushakov commented May 29, 2025

Changelog:

  • Will be checking if sandbox id is provided and skip desktop environment initialisation
  • Added proxy option from the updated E2B SDK

Example:

from e2b_desktop import Sandbox

desktop = Sandbox()
sb_id = desktop.sandbox_id
desktop.stream.start()
stream_url = desktop.stream.get_url()
print('Stream URL:', stream_url)

print("Reconnecting to the sandbox with id:", sb_id)
reconnected_desktop = Sandbox.connect(sb_id)
reconnected_desktop.launch('google-chrome', "https://www.google.com")

print("Press 1 to stop the stream")
while True:
   input = input()
   if input == "1":
       desktop.kill()
       break
   else:
       pass

Would cause "The notification area lost selection" error as it was trying to restart the Desktop environment.

Screenshot 2025-05-27 at 22 04 58

@mishushakov mishushakov requested a review from mlejva as a code owner May 29, 2025 10:32
@mishushakov mishushakov self-assigned this May 29, 2025
@mishushakov mishushakov added the enhancement New feature or request label May 29, 2025
@mishushakov mishushakov enabled auto-merge (squash) May 29, 2025 10:40
@mishushakov mishushakov merged commit aa86c3a into main May 29, 2025
2 checks passed
@mishushakov mishushakov deleted the fix-restarting-desktop-when-reconnecting branch May 29, 2025 10:40
@mishushakov mishushakov removed the request for review from mlejva May 29, 2025 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants