You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fmt.Printf("Found devcontainer.json at %s\n", devcontainerPath)
56
+
57
+
// If subFolder is not empty then use that as the path to open in VS Code (note it should be relative to the folder containing the devcontainer.json/.devcontainer folder)
58
+
// If subFolder is empty and the current folder is contained within the folder containing the devcontainer.json, then open the current folder in VS Code, otherwise open the folder containing the devcontainer.json in VS Code
Copy file name to clipboardExpand all lines: docs/open-in-code.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,11 @@
2
2
3
3
The `devcontainer open-in-code` command opens the current folder in VS Code as a dev container, i.e. it skips the normal step of opening in VS Code and then clicking # on the "Re-open in container" prompt to reload the window as a dev container. With `devcontainer open-in-code` you get straight to the dev container!
4
4
5
-
You can also use `devcontainer open-in-code <path>` to open a different folder as a devcontainer.
5
+
You can also use `devcontainer open-in-code <path>` to open a the devcontainer from a different folder.
6
+
7
+
The command also supports the `--sub-folder` option. This allows you to specify a sub-folder within the folder that contains the devcontainer configuration (i.e. with the `.devcontainer` folder or `.devcontainer.json` file).
8
+
9
+
The `open-in-code` command will walk up the tree from the current/specified folder until it finds a folder with a devcontainer configuration, and then open that folder in VS Code as a dev container.
10
+
If `--sub-folder` is not specified and the devcontainer configuration is found in a parent folder, relative path to the current folder is used as the sub-folder.
6
11
7
12
If you want to use the VS Code Insiders release, you can use `devcontainer open-in-code-insiders`.
0 commit comments