From d66e2780f5877a55c4d0d5aaafb4be18bf4438ee Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Thu, 17 Dec 2020 18:05:31 +0100 Subject: [PATCH] Shortcut pickConnection for only 1 connection --- src/ui-utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui-utils.ts b/src/ui-utils.ts index 855d9e6..048756e 100644 --- a/src/ui-utils.ts +++ b/src/ui-utils.ts @@ -121,5 +121,6 @@ export async function pickComplex(manager: Manager, options: PickComplexOptions) } export const pickConfig = (manager: Manager) => pickComplex(manager, { promptConfigs: true }) as Promise; -export const pickConnection = (manager: Manager, name?: string) => pickComplex(manager, { promptConnections: name || true }) as Promise; +export const pickConnection = (manager: Manager, name?: string) => + pickComplex(manager, { promptConnections: name || true, immediateReturn: !!name }) as Promise; export const pickTerminal = (manager: Manager) => pickComplex(manager, { promptTerminals: true }) as Promise;