Skip to content

Commit 2515872

Browse files
committed
Merge branch 'remove-python-run-button' into canary
2 parents da16dcb + 8bc6f8f commit 2515872

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ RUN npm install --global @vscode/vsce yarn && \
100100
rm --force --recursive design50.vsix && \
101101
npm uninstall --global vsce yarn
102102

103+
# Pull Python VS Code extension and remove run button from editor title menu
104+
RUN cd /tmp && \
105+
git clone --branch v2025.14.0 --depth 1 https://github.com/microsoft/vscode-python.git && \
106+
cd vscode-python && \
107+
# Remove the editor/title/run entry and save back to package.json
108+
jq 'del(.contributes.menus."editor/title/run")' package.json > package.tmp.json && mv package.tmp.json package.json && \
109+
npm install && \
110+
npm run package && \
111+
mv ms-python-insiders.vsix /opt/cs50/extensions && \
112+
cd /tmp && \
113+
rm --force --recursive vscode-python
103114

104115
# Final stage
105116
FROM cs50/cli:${TAG}

devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"/opt/cs50/extensions/ddb50-2.0.0.vsix",
1717
"/opt/cs50/extensions/phpliteadmin-0.0.1.vsix",
1818
"/opt/cs50/extensions/style50-0.0.1.vsix",
19+
"/opt/cs50/extensions/ms-python-insiders.vsix",
1920
"cs50.extension-uninstaller",
2021
"inferrinizzard.prettier-sql-vscode",
2122
"mathematic.vscode-pdf",
@@ -33,7 +34,6 @@
3334
"ms-ceintl.vscode-language-pack-zh-hans",
3435
"ms-ceintl.vscode-language-pack-zh-hant",
3536
"ms-python.autopep8",
36-
"ms-python.python",
3737
"ms-vscode.cpptools",
3838
"ms-vscode.hexeditor",
3939
"ms-vsliveshare.vsliveshare",
@@ -169,6 +169,7 @@
169169
"problems.decorations.enabled": false,
170170
"problems.visibility": false,
171171
"python.terminal.executeInFileDir": true,
172+
"python.terminal.shellIntegration.enabled": false,
172173
"[python]": {
173174
"editor.defaultFormatter": "ms-python.autopep8"
174175
},

opt/cs50/bin/code

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,14 @@ if [ "$options" = false ]; then
8282
fi
8383

8484
# since /opt/cs50/bin already have higher precedence in PATH
85-
$(which -a code | grep remote-cli) "$@" || $(which -a code-insiders | grep remote-cli) "$@"
85+
remote_code=$(which -a code | grep remote-cli)
86+
remote_insiders=$(which -a code-insiders | grep remote-cli)
87+
88+
if [ -n "$remote_code" ]; then
89+
exec "$remote_code" "$@"
90+
elif [ -n "$remote_insiders" ]; then
91+
exec "$remote_insiders" "$@"
92+
else
93+
echo "Error: Could not find VS Code remote CLI" >&2
94+
exit 1
95+
fi

0 commit comments

Comments
 (0)