fetchcontent not prompting for ssh password on powershell

Hi,
I use cpmaddpackage() to add a protected git repo to my project.
I use a password protected ssh key to access the git repo.
Cpmaddpackage is a wrapper for fetchcontent.

When I run
cmake --preset mypreset on Git Bash, everything runs smoothly and the repo is cloned nicely.
However when I tried to configure the project through the VS Code Plugin CMake Tools, the clone fails without an expressive error message.
I started blaming the plugin, but after playing around a little bit I realized that the problem also occurs outside of VS Code, when I run cmake --preset mypreset in powershell.

By configuring git to use ssh in verbose mode, I finally got a sensible error message:
On powershell the clone fails due to not finding “/dev/tty” where I would be prompted for the ssh password.

I can only avoid this by using git bash, which doesnt integrate well into the VS Code Plugin or by using a ssh key that is not password protected, which is not a sustainable option.

Please let me know if anybody encountered a similar bug and was able to solve it

There is a bug on the “VSCode Cmake Tools” repo that discusses this, but i dont think the plugin cannot solve the problem when the issue might be in cmake itself?

In order to prompt for a password, you would need to use the USES_TERMINAL_DOWNLOAD, USES_TERMINAL_UPDATE and possibly other USES_TERMINAL_... keywords. Each one should be followed by a true value (TRUE, YES, 1, …). This gives CMake access to the terminal to ask for a password. From there, it is up to whatever is invoking CMake to ensure a terminal is actually available. CMake can’t do much if a suitable terminal isn’t provided.

In general though, I would strongly recommend not relying on providing a password as input. Instead, try to use something like ssh-agent so that CMake can run non-interactively.