Closed Hector-Work closed 5 months ago
Presumably this line would need to be changed: https://github.com/loft-sh/devpod/blob/979c5467e99c980f6a252df390a003cbbc0f2fdc/desktop/src/components/Terminal/Terminal.tsx#L42C9-L42C27
Hi @Hector-Work, thanks for the suggestion. We're hesitant to add this as it would prevent workspace from starting in environments where interactive shells aren't available by default, like browsers. Additionally, it would open up the workspace to shenanigans as users could run arbitrary commands, most likely as root.
Maybe if you explain you're problem a bit more we're able to find a solution without interactive shells?
Hi @pascalbreuninger , thank you for your response. From your explanation I can see why it may not be desirable to use an interactive terminal.
However, there are situations when getting user input would be helpful. For instance, in my use case, I have a CLI tool that is run as part of the postAttachCommand
. This tool asks for user input to customise the configuration and set up the workspace for their needs.
Maybe there is another way to do this?
Yeah it's a bit of a blind spot of the spec imo. Two options I've seen being used in this scenario:
.devcontainer.json
files for specific scenarios. They need to be in their own subdirectory of .devcontainer
and then users can pick the ones they need by running devpod up $YOUR_REPO --devcontainer-path=".devcontainer/my-config/.devcontainer.json
or passing the path as option in the Desktop AppThanks @pascalbreuninger. As you say, it is probably something missing from the devcontainer spec rather than devpod. I think I will have to go with your second suggestion and add something to the readme to say that the tool will have to be run manually.
Thanks again for your help.
Is your feature request related to a problem?
Yes. Currently I am not able to execute scripts that request user input in any of the devcontainer commands (
onCreateCommand
,postCreateCommand
,postAttachCommand
, etc), because DevPod's output window does not accept input.Which solution do you suggest?
Changing the output window to allow user input.
Which alternative solutions exist?
Running the scripts manually after the IDE has opened. I can't think of any simple way to do this automatically.
Additional context