fix: cannot connect devcontainer by sshkey

This commit is contained in:
Levi Yan
2025-03-24 23:00:40 +08:00
parent ad0eff62c4
commit 5a0078c7b3

View File

@@ -16,9 +16,9 @@ export default class RemoteContainer {
}
async firstOpenProject(host: string, port: number, username: string, path: string) {
this.firstConnect(host, username, port)
await this.firstConnect(host, username, port)
.then((res) => {
if (res == 'success') {
if (res === 'success') {
// only success then open folder
this.openRemoteFolder(host, port, username, path);
}
@@ -148,7 +148,7 @@ export default class RemoteContainer {
openRemoteFolder(host: string, port: number, username: string, path: string): void {
// var host = `${host}-${port}`
var host = `${host}-${port}`
const command = `code --remote ssh-remote+${username}@${host}:${port} ${path} --reuse-window`
let terminal = vscode.window.activeTerminal || vscode.window.createTerminal(`Ext Terminal`);
terminal.show(true);