Describe the bug
The Dev Containers CLI currently has an upstream issue where forwarded ports from devcontainer.json are not properly handled or exposed in some cases:
devcontainers/cli#22
Because of this, the devcontainer-cli.nvim plugin does not correctly recognize or match forwarded ports such as 3000.
Even though this originates from the upstream CLI behavior, the plugin could potentially implement a workaround by reading forwardPorts directly from devcontainer.json and handling the mapping internally.
To Reproduce
Steps to reproduce the behavior:
- Create a
.devcontainer/devcontainer.json file with:
{
"forwardPorts": [3000]
}
- Open the project in Neovim using the plugin
- Start or attach to the devcontainer using the plugin commands
- Run an application inside the container that listens on port
3000
- Observe that the plugin does not correctly detect or expose port
3000
Expected behavior
The plugin could provide a workaround for the upstream Dev Containers CLI limitation by:
- parsing
forwardPorts from devcontainer.json
- tracking configured ports internally
- exposing or forwarding those ports even if the CLI does not report them correctly
This would improve the development experience for common web frameworks that default to port 3000.
Screenshots
If applicable, add screenshots showing:
devcontainer.json
- container logs
- Neovim output/messages
- port forwarding behavior
Desktop (please complete the following information):
- OS: Linux
- Neovim Version: v0.12.2
- Plugin Version: latest
- Devcontainer CLI Version: v0.86
Smartphone (please complete the following information):
- Device: N/A
- OS: N/A
- Browser: N/A
- Version: N/A
Additional context
This issue originates from the upstream Dev Containers CLI behavior:
devcontainers/cli#22
Since VS Code Dev Containers already handles forwarded ports well, adding a plugin-side workaround could help provide a smoother and more expected devcontainer experience inside Neovim.
Describe the bug
The Dev Containers CLI currently has an upstream issue where forwarded ports from
devcontainer.jsonare not properly handled or exposed in some cases:devcontainers/cli#22
Because of this, the
devcontainer-cli.nvimplugin does not correctly recognize or match forwarded ports such as3000.Even though this originates from the upstream CLI behavior, the plugin could potentially implement a workaround by reading
forwardPortsdirectly fromdevcontainer.jsonand handling the mapping internally.To Reproduce
Steps to reproduce the behavior:
.devcontainer/devcontainer.jsonfile with:{ "forwardPorts": [3000] }30003000Expected behavior
The plugin could provide a workaround for the upstream Dev Containers CLI limitation by:
forwardPortsfromdevcontainer.jsonThis would improve the development experience for common web frameworks that default to port
3000.Screenshots
If applicable, add screenshots showing:
devcontainer.jsonDesktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
This issue originates from the upstream Dev Containers CLI behavior:
devcontainers/cli#22
Since VS Code Dev Containers already handles forwarded ports well, adding a plugin-side workaround could help provide a smoother and more expected devcontainer experience inside Neovim.