diff --git a/addons/launcher/src/main/launcher.ts b/addons/launcher/src/main/launcher.ts index 1819344e..95983f4e 100644 --- a/addons/launcher/src/main/launcher.ts +++ b/addons/launcher/src/main/launcher.ts @@ -19,7 +19,7 @@ function fillLauncherIDs(launchers: LauncherInfo[], old: Launcher[] | null) { } return { ...launcher, - id: matched ? matched.id : generateID(), + id: matched ? matched.id : `launcher@${generateID()}`, } }) } diff --git a/addons/launcher/typings/launcher.ts b/addons/launcher/typings/launcher.ts index d44a7d1f..9dc46977 100644 --- a/addons/launcher/typings/launcher.ts +++ b/addons/launcher/typings/launcher.ts @@ -9,5 +9,5 @@ export interface LauncherInfo { } export interface Launcher extends LauncherInfo { - id: number, + id: string, } diff --git a/addons/menu/locales/zh-CN.json b/addons/menu/locales/zh-CN.json index e76e7e5f..3f72e0d3 100644 --- a/addons/menu/locales/zh-CN.json +++ b/addons/menu/locales/zh-CN.json @@ -15,6 +15,7 @@ "Terminal#!menu.terminal": "终端", "New Tab#!menu.newtab": "新建标签页", "Duplicate Tab#!menu.duplicatetab": "复制标签页", + "Split Tab#!menu.splittab": "拆分标签页", "New Window#!menu.newwindow": "新建窗口", "Go Back#!menu.goback": "后退", "Go Forward#!menu.goforward": "前进", diff --git a/resources/terminal.menu.json b/resources/terminal.menu.json index 2a39d380..6721d84c 100644 --- a/resources/terminal.menu.json +++ b/resources/terminal.menu.json @@ -4,15 +4,20 @@ "accelerator": "CmdOrCtrl+T", "command": "open-tab" }, + { + "label": "New Window#!menu.newwindow", + "accelerator": "CmdOrCtrl+N", + "command": "global:open-window" + }, { "label": "Duplicate Tab#!menu.duplicatetab", - "accelerator": "CmdOrCtrl+Shift+D", + "accelerator": "CmdOrCtrl+D", "command": "duplicate-tab" }, { - "label": "New Window#!menu.newwindow", - "accelerator": "CmdOrCtrl+N", - "command": "global:open-window" + "label": "Split Tab#!menu.splittab", + "accelerator": "CmdOrCtrl+Shift+D", + "command": "split-tab" }, { "type": "separator" diff --git a/src/renderer/components/TabItem.vue b/src/renderer/components/TabItem.vue index 1fe2b75c..82219721 100644 --- a/src/renderer/components/TabItem.vue +++ b/src/renderer/components/TabItem.vue @@ -17,10 +17,18 @@ const emit = defineEmits<{ const settings = useSettings() const terminal = $(useCurrentTerminal()) + const isFocused: boolean = $computed(() => { return Boolean(tab) && terminal === tab }) +const isActive = $computed(() => { + if (isFocused) return true + return terminal?.group && tab?.group + && terminal.group.type === tab.group.type + && terminal.group.id === tab.group.id +}) + const pane = $computed(() => { if (!tab) return null return tab.pane @@ -34,7 +42,7 @@ const iconEntry = $computed(() => { }) const title = $computed(() => { - if (group) return group.title + if (group?.title) return group.title return tab ? getTerminalTabTitle(tab) : '' }) @@ -65,7 +73,7 @@ function close() {