vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Automatically open in container

Open turowicz opened this issue 5 years ago • 32 comments

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

turowicz avatar Apr 30 '20 09:04 turowicz

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 avatar Apr 30 '20 14:04 Chuxel

@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.

turowicz avatar Apr 30 '20 16:04 turowicz

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.

yngwi avatar May 01 '20 09:05 yngwi

@yngwi I'm on Ubuntu 20.04 and OSX

turowicz avatar May 02 '20 19:05 turowicz

@yngwi I'm on Ubuntu 20.04 and OSX

I'm sorry, I didn't realize.

yngwi avatar May 02 '20 21:05 yngwi

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

HenkVanMaanen avatar Oct 30 '20 09:10 HenkVanMaanen

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

turowicz avatar Oct 30 '20 11:10 turowicz

@turowicz

What do you mean by:

switched to "Open Repository in Container"

Is this a setting? an extension?

ldiebold avatar Mar 02 '21 22:03 ldiebold

@ldiebold image

turowicz avatar Mar 03 '21 09:03 turowicz

@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.

ldiebold avatar Mar 03 '21 09:03 ldiebold

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

turowicz avatar Mar 03 '21 09:03 turowicz

@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 🤣

ldiebold avatar Mar 03 '21 11:03 ldiebold

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

turowicz avatar Mar 03 '21 11:03 turowicz

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

ldiebold avatar Mar 03 '21 11:03 ldiebold

No, you can have more workstations.

turowicz avatar Mar 03 '21 11:03 turowicz

LOL

turowicz avatar Mar 03 '21 11:03 turowicz

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

jchallenger avatar Jun 18 '21 13:06 jchallenger

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.

NicholasBallard avatar Jun 22 '21 02:06 NicholasBallard

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 .

tobiasdalhof avatar Aug 10 '21 14:08 tobiasdalhof

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!

jrcasso avatar Aug 29 '21 22:08 jrcasso

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).

rhlobo avatar Sep 13 '21 22:09 rhlobo

It is already there. You can run:

devcontainer open .

harnyk avatar Oct 29 '21 07:10 harnyk

It is already there. You can run:

devcontainer open .

For reference, this requires the devcontainer-cli

sjroe avatar Nov 12 '21 20:11 sjroe

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!

peterswords avatar Nov 20 '21 13:11 peterswords

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 avatar Feb 02 '22 17:02 ssbarnea

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?

peterswords avatar Feb 02 '22 18:02 peterswords

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.

ssbarnea avatar Feb 03 '22 12:02 ssbarnea

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

dlangerm avatar Feb 04 '22 15:02 dlangerm

See also #2133

gjsjohnmurray avatar Mar 24 '22 08:03 gjsjohnmurray

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.

cswrd avatar Apr 13 '22 11:04 cswrd