注释掉打开远程文件夹部分内容测试

This commit is contained in:
2025-12-05 11:16:32 +08:00
parent 3b4c3f15f0
commit 3db04f2f0d

View File

@@ -379,13 +379,19 @@ export default class RemoteContainer {
}
}
// 添加延迟确保 SSH 隧道完全建立
await new Promise(resolve => setTimeout(resolve, 3000));
// 使用 --new-window 而不是 --reuse-window避免当前窗口被切换
let terminal = vscode.window.activeTerminal || vscode.window.createTerminal(`Ext Terminal`);
terminal.show(true);
const command = `code --remote ssh-remote+root@${host}:${port} ${path} --reuse-window`;
const command = `code --remote ssh-remote+root@${host}:${port} ${path} --new-window`;
terminal.sendText(command);
vscode.window.showInformationMessage('端口映射已在本地窗口建立,新窗口将打开远程环境');
} catch (error) {
const errorMessage = error instanceof Error ? error.message : '未知错误';
vscode.window.showErrorMessage(`打开远程文件夹失败: ${errorMessage}`);