SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

Prompt should not repeat on escape/cancel #337

Open cmgrayb opened 2 years ago

cmgrayb commented 2 years ago

Issue Description

When using <prompt> for password on a connection, the password prompt will repeat many times and eventually hang the extension in an apparent loop if a valid entry is not provided.

This is particularly a problem for temporary connections which were left connected when closing VSCode and are no longer needed, or connections where the password is rotated and must be queried each time.

Expected Behavior

Canceling or hitting Escape should end the prompt function/routine and stop trying to connect to that profile.

Additional Info

Possibly provide a 'Reconnect on Startup' checkbox per profile to check whether the connection should be attempted or skipped until manually re-established.

SchoofsKelvin commented 2 years ago

I'll see about adding a debounce for identical prompts.

What's happening according to me is that VS Code is requesting to open the required file(s) multiple times, which is quite common as it also tries to read .vscode/settings.json, maybe package.json or similar, etc. Pressing escape cancels the current connection attempt, but since VS Code immediately requests a new file to be read, it re-attempts and therefore reprompts.