Skip to content

Commit d8b08ef

Browse files
Added support for X11 and fixed Windows issue
1 parent 1ccf526 commit d8b08ef

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

src/cmsc/.devcontainer/devcontainer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
"context": "."
77
},
88
"postCreateCommand": "./.devcontainer/setup-extra.sh",
9+
"containerEnv": {
10+
"DISPLAY": "${localEnv:DISPLAY}"
11+
},
12+
"runArgs": [
13+
"--volume", "/tmp/.X11-unix:/tmp/.X11-unix"
14+
],
915
"features": {
1016
"ghcr.io/devcontainers/features/common-utils:2": {
1117
"username": "ubuntu",
@@ -29,5 +35,6 @@
2935
]
3036
}
3137
},
32-
"remoteUser": "ubuntu"
38+
"remoteUser": "ubuntu",
39+
"containerUser": "ubuntu"
3340
}

src/cmsc/.devcontainer/setup-extra.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ set -e
99
# Ensure this directory exists, as some tools expect it
1010
mkdir -p ~/.local/share/
1111

12+
# Fix workspace ownership if needed (especially important on Windows/macOS)
13+
# On Linux with matching UIDs, this is unnecessary and could cause issues
14+
if [ -d /workspaces ] && [ "$(ls -A /workspaces 2>/dev/null)" ]; then
15+
WORKSPACE_OWNER=$(stat -c '%U' /workspaces/* 2>/dev/null | head -1 || echo "")
16+
if [ "$WORKSPACE_OWNER" = "root" ]; then
17+
echo "Fixing workspace ownership (owned by root, changing to ubuntu)..."
18+
sudo chown -R ubuntu:ubuntu /workspaces/* 2>/dev/null || true
19+
fi
20+
fi
21+

src/cmsc/devcontainer-template.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"id": "cmsc",
3-
<<<<<<< Updated upstream
4-
"version": "0.2.1",
5-
=======
6-
"version": "0.2.2",
7-
>>>>>>> Stashed changes
3+
"version": "0.2.3",
84
"name": "UChicago CS",
95
"description": "A devcontainer template for UChicago CS courses.",
106
"publisher": "University of Chicago - Department of Computer Science",

0 commit comments

Comments
 (0)