Skip to content

Commit 99e210c

Browse files
committed
fix(explorer): send to terminal with panes
1 parent 3638855 commit 99e210c

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

addons/explorer/src/renderer/FileExplorerPane.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const target = $computed(() => {
2727
if (!tab.group) return undefined
2828
const siblings = commas.workspace.getTerminalTabsByGroup(tab.group)
2929
.filter(item => item !== tab)
30-
if (siblings.length === 1) return siblings[0]
30+
const teletypes = siblings.filter(item => !item.pane)
31+
if (teletypes.length === 1) return teletypes[0]
3132
})
3233
3334
const isConnected = $computed(() => {

addons/explorer/src/renderer/compositions.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@ export function splitOrCloseFileExplorerTab(directory: string) {
3939
}
4040
const titlePosition = settings['terminal.view.tabListPosition'] === 'top' ? 'bottom' : 'top'
4141
const tab = openFileExplorerTab(directory)
42-
if (current && !current.pane && !current.group) {
43-
commas.workspace.appendTerminalTab(
44-
current,
45-
commas.workspace.getTerminalTabIndex(tab),
46-
titlePosition,
47-
)
42+
if (current && !current.pane) {
43+
const siblings = current.group
44+
? commas.workspace.getTerminalTabsByGroup(tab.group)
45+
.filter(item => item !== current)
46+
: []
47+
if (siblings.every(item => item.pane)) {
48+
commas.workspace.appendTerminalTab(
49+
current,
50+
commas.workspace.getTerminalTabIndex(tab),
51+
titlePosition,
52+
)
53+
}
4854
}
4955
}

0 commit comments

Comments
 (0)