Skip to content

Commit

Permalink
fix(launcher): default profile
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Sep 29, 2024
1 parent fa9dfe7 commit a247e8d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addons/launcher/src/renderer/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ interface OpenLauncherOptions {
duplicate?: boolean,
}

export async function openLauncher(launcher: Launcher, { tab, command, profile, duplicate }: OpenLauncherOptions = {}) {
export async function openLauncher(launcher: Launcher, options: OpenLauncherOptions = {}) {
let { tab, command, profile, duplicate } = options
if (!tab) {
const launcherTabs = getTerminalTabsByLauncher(launcher)
tab = launcherTabs.length ? launcherTabs[0] : undefined
Expand All @@ -76,6 +77,9 @@ export async function openLauncher(launcher: Launcher, { tab, command, profile,
}
return tab
}
if (!profile) {
profile = getLauncherProfile(launcher)
}
if (duplicate) {
return commas.workspace.createTerminalTab(profile, {
command,
Expand All @@ -99,7 +103,6 @@ export async function startLauncher(launcher: Launcher, duplicate?: boolean) {
const shellPath = settings['terminal.shell.path']
return openLauncher(launcher, {
command: getLauncherCommand(launcher, shellPath),
profile: getLauncherProfile(launcher),
duplicate,
})
}
Expand Down

0 comments on commit a247e8d

Please sign in to comment.