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

initializeCommand can block VS Code if it prompts for user input #2434

Closed
mjbvz opened this issue Feb 26, 2020 · 5 comments
Closed

initializeCommand can block VS Code if it prompts for user input #2434

mjbvz opened this issue Feb 26, 2020 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Milestone

Comments

@mjbvz
Copy link

mjbvz commented Feb 26, 2020

Testing #2407

  • VSCode Version:
  • Local OS Version:
  • Remote OS Version:
  • Remote Extension/Connection Type: SSH/Docker/WSL

Steps to Reproduce:

  1. (mistakenly) Create a devcontainer that sets a initializeCommand command that prompts for user input:

    "initializeCommand": "npm init"
    
  2. Open the dev container

Bug

This blocks the container from ever starting properly.

@mjbvz
Copy link
Author

mjbvz commented Feb 26, 2020

Not sure what the expected behavior here is. Is there a way to run scripts in a no user input mode for example?

@chrmarti
Copy link
Contributor

chrmarti commented Mar 3, 2020

Not sure what we can do here in general. Maybe the answer is to run the command in a way that does not require input. E.g., npm init -y.

@chrmarti chrmarti added containers Issue in vscode-remote containers under-discussion Issue is under discussion for relevance, priority, approach labels Mar 3, 2020
@mjbvz
Copy link
Author

mjbvz commented Mar 4, 2020

I don't think we can fully fix the problem. The main thing is that the user experience for a bad initializeCommand is quite poor today: vscode just seems to stall and it's difficult to exit out of this state

@chrmarti
Copy link
Contributor

chrmarti commented Mar 5, 2020

We can investigate connecting user input in the log terminal to the currently running command. Also with that the user might still want to change the command to not require any input.

I'm not sure we can detect when a command is waiting for user input. We could then automatically reveal the log terminal.

@chrmarti
Copy link
Contributor

Connecting initializeCommand to the same terminal we use for postCreateCommand (and others) that also support user input.

@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug and removed under-discussion Issue is under discussion for relevance, priority, approach labels Oct 22, 2021
@chrmarti chrmarti added this to the October 2021 milestone Oct 22, 2021
@tanhakabir tanhakabir added the verified Verification succeeded label Oct 28, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants