Set vscode to use the correct workspace directory (#9698)

This commit is contained in:
Tim O'Farrell 2025-07-14 17:40:32 -06:00 committed by GitHub
parent fbadea9a6f
commit 641d0a0bcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,10 +62,11 @@ class VSCodePlugin(Plugin):
f'Port {self.vscode_port} is not available. VSCode plugin will be disabled.'
)
return
workspace_path = os.getenv('WORKSPACE_MOUNT_PATH_IN_SANDBOX', '/workspace')
cmd = (
f"su - {username} -s /bin/bash << 'EOF'\n"
f'sudo chown -R {username}:{username} /openhands/.openvscode-server\n'
'cd /workspace\n'
f'cd {workspace_path}\n'
f'exec /openhands/.openvscode-server/bin/openvscode-server --host 0.0.0.0 --connection-token {self.vscode_connection_token} --port {self.vscode_port} --disable-workspace-trust\n'
'EOF'
)