'How to code a vscode extension to open remote terminal?

I am working on a vscode extension in which I want to implement a feature that allows my user to launch integrated remote terminals after the user adds ssh configurations.

I was thinking using vscode.windo.createTerminal, and call sendText(ssh ${sshConfig.username}@${sshConfig.host}), however get stuck in after ssh promps password input.

I know there are extensions can do this but just trying to code one for fun, and been reading SSH FS source code but it's just too complicated for me to understand its implementation.

Can anyone please give me some ideas or help me go through it a little bit, or point me to a simpler code implementation?

Much appreciation

PS: I only wanna use plaintext password for authentication not private keys to achieve this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source