`:!git clone <my-repo>` how to prompt user for ssh if ssh is required?

Hi,

If I want to run a shell command that will require user to input their ssh pass, how do I run this command without getting an error? I have tried the following and obviously it did not work :stuck_out_tongue:

:!git clone my-repo-ssh-string

My goal is to build a command that forks a nvim package under my cursor. So atm I run the git clone command and string.format the repo package string into the command but when running vim.cmd(git_clone_repo) then I don’t understand how I would input my password when the shell command asks for it.

I know that ssh works with neogit when I use it so I am going to look into the source and see if I can maybe use the same pattern for running my command.

I am starting to realise that this is not just a simple line of code to fix this so maybe I should close this one and study more on my own?

:! will get you a non-interactive shell connected to a pipe, which is not what you want if you expect user interaction. Use :terminal ... instead.

1 Like