Feat vscode startup (#7518)

Co-authored-by: OpenHands Bot <openhands@all-hands.dev>
This commit is contained in:
tofarr 2025-03-26 16:01:23 -06:00 committed by GitHub
parent 9850f1767a
commit b9af0188fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 3 deletions

View File

@ -37,10 +37,10 @@ class VSCodePlugin(Plugin):
f"su - {username} -s /bin/bash << 'EOF'\n"
f'sudo chown -R {username}:{username} /openhands/.openvscode-server\n'
'cd /workspace\n'
f'exec /openhands/.openvscode-server/bin/openvscode-server --host 0.0.0.0 --connection-token {self.vscode_connection_token} --port {self.vscode_port}\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'
)
print(cmd)
self.gateway_process = subprocess.Popen(
cmd,
stderr=subprocess.STDOUT,

View File

@ -0,0 +1,4 @@
{
"workbench.colorTheme": "Default Dark Modern",
"workbench.startupEditor": "none"
}

View File

@ -135,6 +135,9 @@ RUN \
COPY ./code/pyproject.toml ./code/poetry.lock /openhands/code/
COPY ./code/openhands/runtime/plugins/vscode/settings.json /workspace/.vscode/settings.json
RUN chmod -R a+rwx /workspace/.vscode/settings.json
{{ install_dependencies() }}
# ================================================================
@ -147,6 +150,10 @@ COPY ./code/pyproject.toml ./code/poetry.lock /openhands/code/
# ================================================================
RUN if [ -d /openhands/code/openhands ]; then rm -rf /openhands/code/openhands; fi
COPY ./code/pyproject.toml ./code/poetry.lock /openhands/code/
COPY ./code/openhands/runtime/plugins/vscode/settings.json /workspace/.vscode/settings.json
RUN chmod -R a+rwx /workspace/.vscode/settings.json
COPY ./code/openhands /openhands/code/openhands
RUN chmod a+rwx /openhands/code/openhands/__init__.py

View File

@ -5,7 +5,14 @@ from openhands.core.config import AppConfig
from openhands.core.logger import openhands_logger as logger
from openhands.server.shared import config as shared_config
FILES_TO_IGNORE = ['.git/', '.DS_Store', 'node_modules/', '__pycache__/', 'lost+found/']
FILES_TO_IGNORE = [
'.git/',
'.DS_Store',
'node_modules/',
'__pycache__/',
'lost+found/',
'.vscode/',
]
def sanitize_filename(filename):