Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically open in container #2900

Open
turowicz opened this issue Apr 30, 2020 · 32 comments
Open

Automatically open in container #2900

turowicz opened this issue Apr 30, 2020 · 32 comments
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality plan-review PM-highlighted item determined to be P1 or P2

Comments

@turowicz
Copy link

Please add a setting for always attempting to open in a container if a project contains the .devcontainer folder.

@Chuxel
Copy link
Member

Chuxel commented Apr 30, 2020

Thanks for the suggestion! To verify, would you be looking for something like this:

  1. If the notification appears telling you that you can reopen in container, there's an option that says something along the lines of "always reopen".
  2. If you click it, from that point forward, any time a folder is opened in VS Code with a devcontainer.json present, it just does it.

Moving to the vscode-remote-release repo where we're tracking extension feedback.

@Chuxel Chuxel transferred this issue from microsoft/vscode-dev-containers Apr 30, 2020
@Chuxel Chuxel added feature-request Request for new features or functionality containers Issue in vscode-remote containers labels Apr 30, 2020
@turowicz
Copy link
Author

@Chuxel EXACTLY.

Currently I flip between different projects (8-10 at a time) and each time I have to wait for the popup and click "Reopen in Contanier" manually.

@yngwi
Copy link

yngwi commented May 1, 2020

Hi @turowicz , I'm not sure if you know, but on Windows you can at least "pin" container-projects. This way they are immediately openable from the icon on the taskbar and the start menu. Maybe this helps.

@turowicz
Copy link
Author

turowicz commented May 2, 2020

@yngwi I'm on Ubuntu 20.04 and OSX

@yngwi
Copy link

yngwi commented May 2, 2020

@yngwi I'm on Ubuntu 20.04 and OSX

I'm sorry, I didn't realize.

@HenkVanMaanen
Copy link

HenkVanMaanen commented Oct 30, 2020

Any update on this? Would like to have this feature too.

@turowicz
Copy link
Author

I have switched to "Open Repository in Container". No longer a problem for me.

@bamurtaugh bamurtaugh added the plan-review PM-highlighted item determined to be P1 or P2 label Dec 10, 2020
@ldiebold
Copy link

ldiebold commented Mar 2, 2021

@turowicz

What do you mean by:

switched to "Open Repository in Container"

Is this a setting? an extension?

@turowicz
Copy link
Author

turowicz commented Mar 3, 2021

@ldiebold
image

@ldiebold
Copy link

ldiebold commented Mar 3, 2021

@turowicz Ahh I see. Still kind of a workaround. Maybe we can find an extension that allows us to run a command when the editor has loaded.

@turowicz
Copy link
Author

turowicz commented Mar 3, 2021

@ldiebold if using Docker For Windows, that way the filesystem is much faster and you can get 10x on build times.

@ldiebold
Copy link

ldiebold commented Mar 3, 2021

@turowicz I'm on Linux 😊
It's not so much a speed issue, more of a convenience.

It's lightning fast, but I just don't want to click the button every day 🤣

@turowicz
Copy link
Author

turowicz commented Mar 3, 2021

@ldiebold I'm on Linux too, you can still get 10% off build time.

@ldiebold
Copy link

ldiebold commented Mar 3, 2021

@turowicz now I'm just confused. You can get Docker for windows on Linux?

@turowicz
Copy link
Author

turowicz commented Mar 3, 2021

No, you can have more workstations.

@turowicz
Copy link
Author

turowicz commented Mar 3, 2021

LOL

@jchallenger
Copy link

Would be great if I could open into a devcontainer from the command line, like code . --devcontainer

@NicholasBallard
Copy link

Would be great if I could open into a devcontainer from the command line, like code . --devcontainer

@jchallenger This is what I came here to say.

@tobiasdalhof
Copy link

tobiasdalhof commented Aug 10, 2021

Would be great if I could open into a devcontainer from the command line, like code . --devcontainer

Yes, please!

Edit: See #5428

🔴 Integrate the Dev Container CLI with the VS Code CLI, e.g. code --open-in-devcontainer .

@jrcasso
Copy link

jrcasso commented Aug 29, 2021

Something like code . --devcontainer would be fantastic. The request of this feature support for the CLI is really a testament to the pervasiveness of this development strategy!

@rhlobo
Copy link

rhlobo commented Sep 13, 2021

Looking forward for this code . --devcontainer option.

As stated before, something similar was on the #5428 iteration, but it wasn't implemented, and wasn't moved to the next iteration plan (#5552).

@harnyk
Copy link

harnyk commented Oct 29, 2021

It is already there. You can run:

devcontainer open .

@sjroe
Copy link

sjroe commented Nov 12, 2021

It is already there. You can run:

devcontainer open .

For reference, this requires the devcontainer-cli

@peterswords
Copy link

peterswords commented Nov 20, 2021

I'm not sure if you know, but on Windows you can at least "pin" container-projects. This way they are immediately openable from the icon on the taskbar and the start menu. Maybe this helps.

Fabulous suggestion. (I'm using StartIsBack for Windows 7-style menus). I can pin the dev-container versions of projects:

Also want to mention: VSCode in-container development is the greatest thing since sliced bread!

@ssbarnea
Copy link

ssbarnea commented Feb 2, 2022

Does anyone know how to to tell code to open specific folder using wsl from the command line? That is essential for testing purposes.

@peterswords
Copy link

peterswords commented Feb 2, 2022

Does anyone know how to to tell code to open specific folder using wsl from the command line? That is essential for testing purposes.

@ssbarnea, you can just cd to the folder and type "code ."

(or presumably "code directory-name")

However, when code launches you get an option to "Open in dev container" if it has the write folder structure. Are you asking if you can bypass that and go straight to opening in container?

@ssbarnea
Copy link

ssbarnea commented Feb 3, 2022

The solution is code --remote wsl+Ubuntu /mnt/c/Users/johndoe/c/myrepo and would work if you already have the wsl-remote extension installed. The path given must be the Unix one, so you may need to convert Windows path to Unix. Keep in mind that drive letter becomes lowercase but other things keep the case.

@dlangerm
Copy link

dlangerm commented Feb 4, 2022

Whatever happened to this? I'm building an internal tool for my team and this would be super handy.

@gjsjohnmurray
Copy link

See also #2133

@cswrd
Copy link

cswrd commented Apr 13, 2022

Another workaround: File > Save Workspace As .... On Windows just double click the file. But seems to break if you add additional folders to the workspace.

@sebastiaoLa
Copy link

Hey guys, although we can do it using the devcontainers CLI I would like to do it on a more global way, Is there a change we will get a setting for this?

@amaltson
Copy link

Yes, the hope would be to have a VSCode JSON configuration to have the editor automatically reload if there's a DevContainer or even start up automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality plan-review PM-highlighted item determined to be P1 or P2
Projects
None yet
Development

No branches or pull requests