未验证 提交 feec68e1 编写于 作者: D Daniel Imms 提交者: GitHub

Merge pull request #46518 from alexglazkov9/terminal/bug

fixed terminal doesn't open when window has no folders, fixes #46139
......@@ -117,6 +117,12 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const root = historyService.getLastActiveWorkspaceRoot(Schemas.file);
if (root) {
terminalService.openTerminal(root.fsPath);
} else {
// Opens current file's folder, if no folder is open in editor
const activeFile = historyService.getLastActiveFile();
if (activeFile) {
terminalService.openTerminal(paths.dirname(activeFile.fsPath));
}
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册