1

In my extensionm, I want to call remote-ssh api to open a remote host in a new window, and then get the connect result and error message, and then I want to parse the error message and suggest some fixes to users. First I tried this method:

   vscode.commands.executeCommand('opensshremotes.openEmptyWindow')

But this method requires the user to select a host instead of directly opening the specified host,which is not what I need. Then I used a method which was found in an issue (But I didn't find any API documentation about this) :

   const response = vscode.commands.executeCommand("vscode.newWindow", {
       remoteAuthority: `ssh-remote+${sshName}`
   }

This method can open the specified host, but I can not get result of it. So I want to ask:

  1. What is the recommended way to open a specified ssh host by code?
  2. How to get the error message, such as connect timeout or permission denied ?

Thank you~

sunnysnow.hi
  • 33
  • 1
  • 4
  • The response is like this: Promise {[[PromiseState]]: 'pending', [[PromiseResult]]: undefined, Symbol(async_id_symbol): 2757, Symbol(trigger_async_id_symbol): 2750, Symbol(destroyed): {…}} . – sunnysnow.hi Apr 08 '22 at 02:27

0 Answers0