When is ~/.vscode-remote/bin available? #132202
-
Select Topic AreaQuestion BodyI have some code in onCreateCommand to automatically install some VSCode extensions using This is working in VSCode using the Now, it looks like in Codespaces, the command would be |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
@rubensa
For seamless setup, add extensions in the |
Beta Was this translation helpful? Give feedback.
-
It seems like you're facing a timing issue where the ~/.vscode-remote/bin folder isn't available when the onCreateCommand is executed in your Codespaces environment. Here are a few strategies to work around this problem: Delay Execution: Bash code: |
Beta Was this translation helpful? Give feedback.
-
Doing some test, looks like So the command would be ~/.vscode-remote/bin/*/bin/remote-cli/code --install-extension ${extension} --force but, again, this is not available by the time onCreateCommand is run in Codespaces. @54J4N Thanks for your help. The thing is that the extensions to be installed, in my case, comes from two independent files (config outside devcontainer.json). I suppose I need to use postAttachCommand here, checking if extensions are already installed before trying to install them again (but it would be great if this would work as inside VSCode devcontainers where the command is already available by the time when onCreateCommand is executed). Do you know if there is more detailed info about execution order other than Understanding the codespace lifecycle? @ChandruMuthuswamy Thanks for you suggestion but, as @54J4N suggest, looks like the ~/.vscode-remote/bin folder might be created in other Codespaces lifecycle as the wait loop keeps running for ever. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
I ended up creating a Task that is executed
onFolderOpen
that checks if specified extensions are already installed and installs them if not. This solution works both for Docker devcontainer and Codespaces. The downside is that it is always executed when the project folder is Opened.